Permutation by number
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Find a permutation by its number in the lexicographical order.
Input
The first line of the input file is written the number N (1 ≤ N ≤ 12) - the number of elements in the permutation.
In the second row the number of K (1 ≤ K ≤ N!) - number of the permutation.
Output
The output file output of N numbers - the desired permutation.
Examples
Input #1
Answer #1
Submissions 776
Acceptance rate 29%