You are given a sequence of integers a_0, a_1, \dots, a_{n-1} consisting of pairwise distinct elements, each belonging to the range [0; n - 1].
An operation (i, j)~(0 \le i, j \le n - 1) is called a swap, which exchanges the values of a_i and a_j.
Sort the sequence in ascending order using the minimum number of swaps. Print all performed swaps.
The first line contains one positive integer n~(n \le 10^6).
The second line contains distinct integers from the range [0; n - 1].
In the first line, print the minimum number of swaps .
In the following lines, print all performed swaps as pairs .
Example 1
Example 2