K-th Smallest in Lexicographic Order — CaffeCode