Final year is approaching. Shirogane and Shinomiya, both highly prestigious students, have taken the maximum number of courses
Although they have the same courses, the order of the courses in their schedules may vary, with Shirogane's schedule being
Since the number of courses is extremely large, he bribes requests your help as the coding club president to write a program that assists him.
Constraints
Subtask 1 [5/15]
Subtask 2 [5/15]
No course appears more than once in Shirogane's schedule. Formally, if
Subtask 3 [5/15]
No additional constraints.
Input Specification
The first line contains an integer
The second line contains
The third line contains
Output Specification
On the first line, output one integer
On each of the next
Note: You do not need to find the shortest sequence of swaps. If there are multiple valid solutions, output any of them. Also, it can be proven that it is always possible to make Shirogane's schedule match Shinomiya's in at most
Sample Input 1
3
3 1 2
1 2 3
Sample Output 1
2
1 2
2 3
Explanation for Sample 1
In the first swap, course
In the second swap, course
Sample Input 2
5
2 2 1 1 3
1 1 3 2 2
Sample Output 2
3
3 5
1 5
2 4
Sample Input 3
3
1 1 1
1 1 1
Sample Output 3
0
Comments