You are given a permutation . You may perform the following operation any number of times.
Print the minimum number of operations required to sort the permutation in increasing order and one sequence of operations attaining that minimum.
The input is given from Standard Input in the following format:
For each test case, first print the minimum number of operations .
Then print lines containing the chosen for each operation in order. If there are multiple optimal sequences, print any of them.
The elements in the interval are and . Swapping the positions of the smallest and second-smallest elements in this interval changes the permutation to . Since the original permutation is not sorted, the minimum number of operations is .
Each case is given in the following format: