F. Exchanges
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given two sequences of integers $$$a_1, a_2, \ldots, a_n$$$ and $$$b_1, b_2, \ldots, b_n$$$.

Determine the minimum number of exchanges of pairs of elements in the sequence $$$a$$$ required for $$$a$$$ to match $$$b$$$.

Input

The first line contains a single integer $$$n$$$ ($$$1 \le n \le 30$$$) — the length of the sequences.

The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le n$$$).

The third line contains $$$n$$$ integers $$$b_1, b_2, \ldots, b_n$$$ ($$$1 \le b_i \le n$$$).

It is guaranteed that $$$a$$$ and $$$b$$$ are equal when the elements within each of them are sorted in non-decreasing order. Elements in the sequences may repeat.

Output

In the first line, print $$$m$$$ — the minimum number of exchanges required to transform $$$a$$$ into $$$b$$$.

In the $$$i$$$-th of the following $$$m$$$ lines, print two distinct integers $$$x_i, y_i$$$ ($$$1 \le x_i, y_i \le n$$$), indicating that in the $$$i$$$-th exchange, $$$a_{x_i}$$$ and $$$a_{y_i}$$$ should be swapped.

Examples
Input
3
1 2 3
3 2 1
Output
1
1 3
Input
4
1 1 2 2
2 2 1 1
Output
2
2 3
1 4
Input
9
1 3 2 2 1 3 3 2 1
2 1 3 3 2 1 1 3 2
Output
6
9 3
3 2
5 4
4 6
1 8
8 7