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
/**
 * @author derrick20
 */

import java.io.*;
import java.util.*;

public class ColumnsSwaps implements Runnable {
    public static void main(String[] args) throws Exception {
        new Thread(null, new ColumnsSwaps(), ": )", 1 << 28).start();
    }

    public void run() {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        int T = sc.nextInt();
        while (T-- > 0) {
            int N = sc.nextInt();
            int[][] rows = new int[2][N + 1];
            int[] ct = new int[N + 1];
            for (int i = 1; i <= N; i++) {
                rows[0][i] = sc.nextInt();
                ct[rows[0][i]]++;
            }
            for (int i = 1; i <= N; i++) {
                rows[1][i] = sc.nextInt();
                ct[rows[1][i]]++;

            }
            boolean valid = true;
            for (int color = 1; color <= N; color++) {
                if (ct[color] != 2) {
                    valid = false;
                }
            }
            if (!valid) {
                out.println(-1);
            } else {
                ArrayList<Integer>[] adjList = new ArrayList[N + 1];
                ArrayList<Integer>[] link = new ArrayList[N + 1];
                Arrays.setAll(adjList, i -> new ArrayList<>());
                Arrays.setAll(link, i -> new ArrayList<>());
                int[][] colorToColumn = new int[2][N + 1];
                for (int i = 1; i <= N; i++) {
                    if (colorToColumn[0][rows[0][i]] == 0) {
                        colorToColumn[0][rows[0][i]] = i;
                    } else {
                        // we see a second occurrence, so they're connected
                        int u = colorToColumn[0][rows[0][i]];
                        adjList[u].add(i);
                        adjList[i].add(u);
                    }
                    if (colorToColumn[1][rows[1][i]] == 0) {
                        colorToColumn[1][rows[1][i]] = i;

                    } else {
                        // we see a second occurrence, so they're connected
                        int u = colorToColumn[1][rows[1][i]];
                        adjList[u].add(i);
                        adjList[i].add(u);
                    }
                }

//                System.out.println(Arrays.toString(colorToColumn[0]));
//                System.out.println(Arrays.toString(colorToColumn[1]));
                for (int color = 1; color <= N; color++) {
                    if (colorToColumn[0][color] != 0 && colorToColumn[1][color] != 0) {
                        // both rows contain this color!
                        // if the other occurrence of the color is on top side, then it's a link
                        int u = colorToColumn[0][color];
                        int v = colorToColumn[1][color];
                        if (u != v) {
                            link[u].add(v);
                            link[v].add(u);
                        }
                    }
                }
//                System.out.println(Arrays.toString(link));
                // check for 2-colorability now
                ArrayDeque<Integer> ans = new ArrayDeque<>();
                int[] vis = new int[N + 1];
                Arrays.fill(vis, -1);
                for (int i = 1; i <= N; i++) {
                    if (vis[i] == -1) {
                        ArrayDeque<Integer>[] halves = new ArrayDeque[2];
                        Arrays.setAll(halves, z -> new ArrayDeque<>());
                        vis[i] = 0;
                        halves[0].add(i);
                        ArrayDeque<Integer> q = new ArrayDeque<>();
                        q.add(i);
                        int otherEnd = findBorder(i, link, vis, halves);
                        if (otherEnd != i) {
                            q.add(otherEnd);
                        }
                        while (q.size() > 0) {
                            int curr = q.pollFirst();
//                            System.out.println("Visiting " + curr);
                            ASSERT(adjList[curr].size() <= 2);
                            for (int adj : adjList[curr]) {
                                if (vis[adj] == -1) {
//                                    System.out.println("branching into " + adj);
                                    vis[adj] = 1 - vis[curr]; // opposite
                                    halves[vis[adj]].add(adj);
                                    int last = findBorder(adj, link, vis, halves);
                                    q.add(adj);
                                    if (last != adj) {
                                        q.add(last); // this is where it ends
                                    }
                                } else if (vis[adj] == vis[curr]) {
                                    failed = true; // they should NOT match
                                }
                            }
                        }
//                        System.out.println("Searching from " + i);
//                        System.out.println("Half 0 " + halves[0]);
//                        System.out.println("Half 1 " + halves[1]);
                        if (halves[0].size() < halves[1].size()) {
                            ans.addAll(halves[0]);
                        } else {
                            ans.addAll(halves[1]);
                        }
                    }
                }
                if (failed) {
                    out.println(-1);
                } else {
                    out.println(ans.size());
                    StringBuilder sb = new StringBuilder();
                    for (int v : ans) {
                        sb.append(v).append(" ");
                    }
                    out.println(sb);
                }
            }
        }
        out.close();
    }

    static boolean failed;

    static int findBorder(int adj, ArrayList<Integer>[] link, int[] vis, ArrayDeque<Integer>[] halves) {
        ArrayDeque<Integer> q = new ArrayDeque<>();
        q.add(adj);
        int last = adj;
        while (q.size() > 0) {
            int node = q.pollFirst();
            for (int conn : link[node]) {
                // this should be essentially
                // a linear walk outward
                if (vis[conn] == -1) {
//                    System.out.println("Reached " + conn + " From " + adj);
                    vis[conn] = vis[adj];
                    q.add(conn);
                    halves[vis[adj]].add(conn);
                    last = conn;
                } else if (vis[conn] != vis[node]) {
                    failed = true; // they should all match
                }
            }
        }
//        System.out.println(Arrays.toString(halves));
        return last;
    }

    static class FastScanner {
        private int BS = 1 << 16;
        private char NC = (char) 0;
        private byte[] buf = new byte[BS];
        private int bId = 0, size = 0;
        private char c = NC;
        private double cnt = 1;
        private BufferedInputStream in;

        public FastScanner() {
            in = new BufferedInputStream(System.in, BS);
        }

        public FastScanner(String s) {
            try {
                in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
            } catch (Exception e) {
                in = new BufferedInputStream(System.in, BS);
            }
        }

        private char getChar() {
            while (bId == size) {
                try {
                    size = in.read(buf);
                } catch (Exception e) {
                    return NC;
                }
                if (size == -1) return NC;
                bId = 0;
            }
            return (char) buf[bId++];
        }

        public int nextInt() {
            return (int) nextLong();
        }

        public int[] nextInts(int N) {
            int[] res = new int[N];
            for (int i = 0; i < N; i++) {
                res[i] = (int) nextLong();
            }
            return res;
        }

        public long[] nextLongs(int N) {
            long[] res = new long[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextLong();
            }
            return res;
        }

        public long nextLong() {
            cnt = 1;
            boolean neg = false;
            if (c == NC) c = getChar();
            for (; (c < '0' || c > '9'); c = getChar()) {
                if (c == '-') neg = true;
            }
            long res = 0;
            for (; c >= '0' && c <= '9'; c = getChar()) {
                res = (res << 3) + (res << 1) + c - '0';
                cnt *= 10;
            }
            return neg ? -res : res;
        }

        public double nextDouble() {
            double cur = nextLong();
            return c != '.' ? cur : cur + nextLong() / cnt;
        }

        public double[] nextDoubles(int N) {
            double[] res = new double[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextDouble();
            }
            return res;
        }

        public String next() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c > 32) {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }

        public String nextLine() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c != '\n') {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }

        public boolean hasNext() {
            if (c > 32) return true;
            while (true) {
                c = getChar();
                if (c == NC) return false;
                else if (c > 32) return true;
            }
        }
    }

    static void ASSERT(boolean assertion, String message) {
        if (!assertion) throw new AssertionError(message);
    }

    static void ASSERT(boolean assertion) {
        if (!assertion) throw new AssertionError();
    }
}