Consider all permutations of the integers 1 to n, listed in increasing lexicographic order (comparing them as sequences of numbers, position by position). Given n and a 1-indexed rank k, output the k-th permutation in this ordering.
Input format
Line 1: two integers n and k.
Output format
The k-th permutation of 1..n in lexicographic order, printed as n space-separated integers on one line.
Constraints
- 2 ≤ n ≤ 8
- 1 ≤ k ≤ n!