A permutation of length is given.
In one reversal, choose two integers satisfying both conditions below.
- .
- .
Then reverse the order of the contiguous segment .
Sort in increasing order using at most reversals, and print the reversals you used.
Input
The input is given from Standard Input in the following format:
case case case
Each case is given in the following format:
Output
For each test case, print the number of reversals on the first line.
Then print lines. On the -th line, print the two integers chosen for the -th reversal.
The output must satisfy all conditions below.
- .
- ().
- ().
- After applying every printed reversal in order, the permutation must be .
If there are multiple solutions, print any of them.
Constraints
- .
- .
- is a permutation of .
- The sum of over all test cases does not exceed .
Subtasks
Samples
In the first test case, every printed interval has length at least . In the second test case, every printed interval has length at least . Applying the printed reversals in order sorts both permutations.