E. Esoteric Computer Architecture
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

Have you heard of esoteric programming languages? These are languages designed for experimentation, artistic expression, or humor, rather than practical use.

Inspired by this idea, Ángel designed a simulated computer with an esoteric computer architecture for his final project in the Computer Architecture class. Unlike conventional computers, Ángel's machine represents data using the decimal numeral system at the hardware level.

To demonstrate his project, Ángel plans to run several programs. One of them transforms an array $$$A = [a_1, a_2, \dots, a_n]$$$ into an array $$$B = [b_1, b_2, \dots, b_n]$$$ using only the swap instruction, which Ángel included as a native operation.

However, Ángel discovered a critical bug in the swap instruction. When swapping two values, the instruction not only exchanges them but also trims the operand with more digits to match the number of digits of the shorter operand by removing the most significant digits.

For example, swapping positions $$$2$$$ and $$$4$$$ in $$$[5,13564,2,23]$$$ results in $$$[5,23,2,64]$$$ ($$$13564$$$ and $$$23$$$ are swapped, and $$$13564$$$ becomes $$$64$$$ to match the two-digit length of $$$23$$$).

After further investigation, Ángel realized that the bug was worse than he had initially thought. The swap instruction preserves leading zeros after a number is trimmed, and the leading zeros persist across the swap instruction unless they are trimmed to match the length of a shorter number.

For example, swapping positions $$$1$$$ and $$$2$$$ in $$$[101,11,123]$$$, results in $$$[11, 01, 123]$$$, and swapping positions $$$2$$$ and $$$3$$$ in the previous array, results in $$$[11, 23, 01]$$$.

Ángel traced the bug to a faulty hardware simulation. Rebuilding it would take too long, so he asks for your help: transform $$$A$$$ into $$$B$$$ using at most $$$2n$$$ buggy swaps, such that the final array does not contain any leading zeros (but it may contain leading zeros during intermediate steps), since his teacher will consider it as a serious flaw if the final array contains any leading zero.

Input

Each test contains multiple test cases. The first line contains the number of test cases $$$(1 \leq t \leq 5\cdot 10^5)$$$. The description of the test cases follows.

The first line of each test case contains a line $$$n$$$ ($$$1 \leq n \leq 5\cdot 10^5$$$).

The second line contains $$$n$$$ integers $$$a_1,a_2,\dots,a_n$$$ ($$$0 \leq a_i \lt 10^9$$$).

The third line contains $$$n$$$ integers $$$b_1,b_2,\dots,b_n$$$ ($$$0 \leq b_i \lt 10^9$$$).

It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$5\cdot 10^5$$$.

Output

For each test case, print $$$-1$$$ if it is not possible to transform $$$A$$$ into $$$B$$$ using at most $$$2n$$$ swaps.

Otherwise, print the number of times to perform a buggy swap instruction in the first line of the output. This number should be in the range $$$[0,2n]$$$. Then print one line per swap instruction in order. In each line, print two integers — the indices of positions to swap.

If there are multiple solutions, print any of them.

Example
Input
5
4
5 13564 2 23
2 23 5 64
2
1 21
2 1
4
101 11 123 1
11 23 1 1
1
0
0
2
101 11
11 1
Output
2
2 4
3 1
-1
3
1 2
2 3
3 4
0
-1