I. Permutation

Time Limit: 10 sec

Description

Given a subsequence of a permutation of n elements (1, 2, ..., n ), you have to find the K-th permutation in lexicographic order that contains the subsequence given.

For example:

If you have 1, 3, 2 and n equals to 4 you can obtain these permutations:

1, 3, 2, 4
1, 3, 4, 2
1, 4, 3, 2
4, 1, 3, 2

The Input

Input file contains several test cases. The first line of the test case contains three integers n (1 <= n <= 250), m (0 < m <= n) m is the number of the elements of the subsequence and K , in the next line contains m integers.

The Output

For each test case write a K-th permutation that satisfies the condition, one per line.

Notice: K-th position always exists.

Sample Input Sample Output
4 3 1
1 3 2
4 3 3
1 3 2
4 3 4
1 3 2
8 4 1000
8 2 4 1
1 3 2 4
1 4 3 2
4 1 3 2
8 2 4 7 1 5 6 3

Problemsetter: Rodrigo Burgos Domínguez