#P1571I. Physical Examination

    ID: 403 Type: RemoteJudge 4000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>*special problembinary searchdata structures*3200

Physical Examination

No submission language available for this problem.

Description

Polycarp plans to undergo a full physical examination at his local clinic. There are nn doctors, numbered from 11 to nn. The ii-th doctor takes patients from minute LiL_i to minute RiR_i, so Polycarp can visit him at any minute in this range. It takes each doctor exactly one minute to examine Polycarp's health.

Polycarp wants to arrive at the clinic at some minute xx and visit all nn doctors in some order without waiting or visiting any doctor several times.

More formally, he chooses an integer xx and a permutation p1,p2,,pnp_1, p_2, \dots, p_n (a sequence of nn integers from 11 to nn such that each integer appears exactly once), then proceeds to visit:

  • doctor p1p_1 at minute xx;
  • doctor p2p_2 at minute x+1x+1;
  • ...
  • doctor pnp_n at minute x+n1x+n-1.

The pip_i-th doctor should be able to take patients at minute x+i1x+i-1, so the following should hold: L[pi]x+i1R[pi]L[p_i] \le x + i - 1 \le R[p_i].

Determine if it's possible for Polycarp to choose such a minute xx and a permutation pp that he'll be able to visit all nn doctors in without waiting or visiting any doctor several times. If there are multiple answers, print any of them.

The first line contains a single integer tt (1t1001 \le t \le 100) — the number of testcases.

Then the descriptions of tt testcases follow.

The first line of the testcase contains a single integer nn (1n1051 \le n \le 10^5) — the number of doctors.

The second line of the testcase contains nn integers L1,L2,LnL_1, L_2, \dots L_n (1Li1091 \le L_i \le 10^9).

The third line of the testcase contains nn integers R1,R2,RnR_1, R_2, \dots R_n (LiRi109L_i \le R_i \le 10^9).

The sum of nn over all testcases doesn't exceed 10510^5.

For each testcase print an answer.

If there exists such a minute xx and a permutation pp that Polycarp is able to visit all nn doctors without waiting or visiting any doctor several times, then print xx in the first line and a permutation pp in the second line. If there are multiple answers, print any of them.

Otherwise, print 1-1 in the only line.

Input

The first line contains a single integer tt (1t1001 \le t \le 100) — the number of testcases.

Then the descriptions of tt testcases follow.

The first line of the testcase contains a single integer nn (1n1051 \le n \le 10^5) — the number of doctors.

The second line of the testcase contains nn integers L1,L2,LnL_1, L_2, \dots L_n (1Li1091 \le L_i \le 10^9).

The third line of the testcase contains nn integers R1,R2,RnR_1, R_2, \dots R_n (LiRi109L_i \le R_i \le 10^9).

The sum of nn over all testcases doesn't exceed 10510^5.

Output

For each testcase print an answer.

If there exists such a minute xx and a permutation pp that Polycarp is able to visit all nn doctors without waiting or visiting any doctor several times, then print xx in the first line and a permutation pp in the second line. If there are multiple answers, print any of them.

Otherwise, print 1-1 in the only line.

Samples

Sample Input 1

5
3
2 3 1
3 3 2
8
6 6 5 4 9 4 3 6
7 6 10 6 9 6 6 8
2
4 2
4 2
3
2 2 2
3 3 3
1
5
10

Sample Output 1

1
3 1 2 
3
7 4 6 2 1 8 5 3 
-1
-1
7
1

Note

In the third testcase it's impossible to visit all doctors, because Polycarp has to visit doctor 22 at minute 22 and doctor 11 at minute 44. However, that would require him to wait a minute between the visits, which is not allowed.

In the fourth testcase all doctors take patients in the span of 22 minutes. However, since there are three of them, Polycarp can't visit them all.