- Time limit: 1.00 s
- Memory limit: 512 MB
Your task is to create a permutation of numbers whose longest monotone subsequence has exactly elements.
A monotone subsequence is either increasing or decreasing. For example, some monotone subsequences in are and .
Input
The first input line has an integer : the number of tests.
After this, there are lines. Each line has two integers and .
Output
For each test, print a line that contains the permutation. You can print any valid solution. If there are no solutions, print IMPOSSIBLE
.
Constraints
Example
Input:
3 5 3 5 2 7 7
Output:
2 1 4 5 3 IMPOSSIBLE 1 2 3 4 5 6 7