S'all good, man.
- James McGill, Better Call Saul
Saul Goodman is the best lawyer in the world. He believes that until proven guilty, every man, woman, and child in this country is innocent. However, one client of Saul is not so innocent.
Saul needs to build a solid story for his defense. There were events, numbered from to . Saul needs to come up with an order , in which these events happened. His client, however, has a poor memory! If Saul tells him to remember permutation of events, he will remember permutation , where is some (fixed) permutation of integers from to .
Saul wants their permutations to be as consistent as possible: he wants to maximize the value of . Help him to find permutation which maximizes this value! If there are many such permutations, find any of them.
Here denotes the length of the longest common subsequence of sequences and . For example, , and one of the common subsequences of length is .
Input data
The first line contains a single integer () - the number of test cases. The description of test cases follows.
The first line of each test case contains a single integer () - the length of the permutation.
The second line of each test case contains integers (, all are distinct) - the elements of the permutation.
It is guaranteed that the sum of over all test cases does not exceed .
Output data
For each test case, output integers (, all are distinct) ~--- any permutation of integers from to , which maximizes the value of .
Example
stdin
2
4
1 2 3 4
6
6 5 4 3 2 1
stdout
1 2 3 4
1 6 2 5 3 4
Explanation
In the first test case, for , we have = .
In the second test case, for , we have:
= = 3KaTeX parse error: Can't use function '$' in math mode at position 40: β¦nces of length $Μ²3
is .