You are given a table a of size 2 × n (i.e. two rows and n columns) consisting of integers from 1 to n.

In one move, you can choose some column j (1 ≤ j ≤ n) and swap values a_{1, j} and a_{2, j} in it. Each column can be chosen no more than once.

Your task is to find the minimum number of moves required to obtain permutations of size n in both first and second rows of the table or determine if it is impossible to do that.

You have to answer t independent test cases.

Recall that the permutation of size n is such an array of size n that contains each integer from 1 to n exactly once (the order of elements doesn't matter).

Input

The first line of the input contains one integer t (1 ≤ t ≤ 2 ⋅ 10^4) — the number of test cases. Then t test cases follow.

The first line of the test case contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of columns in the table. The second line of the test case contains n integers a_{1, 1}, a_{1, 2}, ..., a_{1, n} (1 ≤ a_{1, i} ≤ n), where a_{1, i} is the i-th element of the first row of the table. The third line of the test case contains n integers a_{2, 1}, a_{2, 2}, ..., a_{2, n} (1 ≤ a_{2, i} ≤ n), where a_{2, i} is the i-th element of the second row of the table.

It is guaranteed that the sum of n does not exceed 2 ⋅ 10^5 (∑ n ≤ 2 ⋅ 10^5).

Output

For each test case print the answer: -1 if it is impossible to obtain permutation of size n in both first and the second rows of the table, or one integer k in the first line, where k is the minimum number of moves required to obtain permutations in both rows, and k distinct integers pos_1, pos_2, ..., pos_k in the second line (1 ≤ pos_i ≤ n) in any order — indices of columns in which you need to swap values to obtain permutations in both rows. If there are several answers, you can print any.

Example

Input


6
4
1 2 3 4
2 3 1 4
5
5 3 5 1 4
1 2 3 2 4
3
1 2 1
3 3 2
4
1 2 2 1
3 4 3 4
4
4 3 1 4
3 2 2 1
3
1 1 2
3 2 2


Output


0

2
2 3 
1
1 
2
3 4 
2
3 4 
-1
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.util.ArrayList;
    import java.util.HashSet;
    import java.util.StringTokenizer;
     
    public class Task7 {
        boolean[] visited;
        int[][] ar;
        int[][] orgAr;
        int[][] colsOfANum;
     
        public static void main(String[] args) throws IOException  {
            new Task7().solve();
        }
     
        private void solve() throws IOException {
            BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
            PrintWriter out = new PrintWriter(System.out);
     
            int t = Integer.parseInt(f.readLine());
            for (int t1 = 0; t1 < t; t1++) {
                int n = Integer.parseInt(f.readLine());
                int[][] count = new int[n + 1][2];
                ar = new int[2][n];
                colsOfANum = new int[n + 1][2];
                orgAr = new int[2][n];
                for (int j = 0; j < 2; j++) {
                    StringTokenizer tokenizer = new StringTokenizer(f.readLine());
                    for (int i = 0; i < n; i++) {
                        ar[j][i] = Integer.parseInt(tokenizer.nextToken());
                        orgAr[j][i] = ar[j][i];
                        if (colsOfANum[ar[j][i]][0] == 0) {
                            colsOfANum[ar[j][i]][0] = i;
                        } else {
                            colsOfANum[ar[j][i]][1] = i;
                        }
                        count[ar[j][i]][j]++;
                    }
                }
     
                boolean impossible = false;
                for (int i = 1; i <= n; i++) {
                    if (count[i][0] + count[i][1] != 2) {
                        impossible = true;
                        break;
                    }
                }
                if (impossible) {
                    out.println(-1);
                    continue;
                }
     
                visited = new boolean[n];
                ArrayList<Integer> swaps = new ArrayList<Integer>();
                for (int i = 0; i < n; i++) {
                    if (!visited[i]) {
                        if (ar[0][i] == ar[1][i]) continue;
                        int num = ar[0][i];
                        ArrayList<Integer> swaps1 = new ArrayList<Integer>();
                        ArrayList<Integer> swaps2 = new ArrayList<Integer>();
                        boolean possible1 = trySwap(i, true, num, swaps1);
                        cleanState(i);
                        boolean possible2 = trySwap(i, false, num, swaps2);
                        //System.out.println(possible1 + " " + possible2 + " " + swaps1.size() + " " + swaps2.size());
                        if ((possible1 || possible2) == false) {
                            //System.out.println(t1);
                            impossible = true;
                            break;
                        } else if (!possible2 || (possible1 && swaps1.size() < swaps2.size())) {
                            swaps.addAll(swaps1);
                        } else {
                            swaps.addAll(swaps2);
                        }
                    }
                }
     
                if (impossible) {
                    out.println(-1);
                    continue;
                }
     
     
     
                out.println(swaps.size());
                if (!swaps.isEmpty()) {
                    out.print(swaps.get(0) + 1);
                    for (int i = 1; i < swaps.size(); i++) {
                        out.print(" ");
                        out.print(swaps.get(i) + 1);
                    }
                }
                out.println();
            }
     
            out.close();
        }
     
        private void cleanState(int col) {
            //System.out.println(col);
            if (visited[col]) {
                ar[0][col] = orgAr[0][col];
                ar[1][col] = orgAr[1][col];
                visited[col] = false;
                for (int i = 0; i < 2; i++) {
                    if (colsOfANum[ar[i][col]][0] != col) {
                        if (visited[colsOfANum[ar[i][col]][0]]) {
                            cleanState(colsOfANum[ar[i][col]][0]);
                        }
                    } else {
                        if (visited[colsOfANum[ar[i][col]][1]]) {
                            cleanState(colsOfANum[ar[i][col]][1]);
                        }
                    }
                }
            }
        }
     
        private boolean trySwap(int col, boolean isUp, int num, ArrayList<Integer> swaps) {
            int indexLooking;
            int indexOther;
            if (isUp) {
                indexLooking = 0;
                indexOther = 1;
            } else {
                indexLooking = 1;
                indexOther = 0;
            }
            //System.out.println(col + " " + isUp + " " + num + " " + (ar[indexLooking][col] != num));
     
            if (visited[col]) {
                if (ar[indexLooking][col] != num) return false;
                else return true;
            }
     
     
            if (ar[indexLooking][col] != num) {
                swaps.add(col);
                int temp = ar[indexOther][col];
                ar[indexOther][col] = ar[indexLooking][col];
                ar[indexLooking][col] = temp;
            }
     
            visited[col] = true;
            boolean possible = true;
            if (colsOfANum[ar[indexLooking][col]][0] != col) {
                possible = possible && trySwap(colsOfANum[ar[indexLooking][col]][0], !isUp, ar[indexLooking][col], swaps);
            } else {
                possible = possible && trySwap(colsOfANum[ar[indexLooking][col]][1], !isUp, ar[indexLooking][col], swaps);
            }
            if (colsOfANum[ar[indexOther][col]][0] != col) {
                possible = possible && trySwap(colsOfANum[ar[indexOther][col]][0], isUp, ar[indexOther][col], swaps);
            } else {
                possible = possible && trySwap(colsOfANum[ar[indexOther][col]][1], isUp, ar[indexOther][col], swaps);
            }
     
            return possible;
        }
    }