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: Anthony Ngene
    Created: 22/07/2020 - 10:41
*/

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

public class C2_2 {
    // A mind is like a parachute. It doesn’t work if it isn’t open. – Frank Zappa
    private static final FastWriter out = new FastWriter();
    static ArrayList<Integer>[] adj;
    static HashMap<Integer, int[]> pos;
    static boolean isInvalid;
    static StringBuilder res;

    public static void main(String[] args) throws IOException {
        CF_Reader in = new CF_Reader();

        int cases = in.intNext();
        for (int t = 1; t <= cases; t++) {
            int n = in.intNext();
            pos = new HashMap<>();
            isInvalid = false;
            int[] first = in.nextIntArray(n);
            int[] second = in.nextIntArray(n);
            if (isInvalid) {
                out.println("-1");
                continue;
            }
            res = new StringBuilder();
            int total = 0;
            for (int i = 0; i < n; i++) {
                if (first[i] == -1 || first[i] == second[i]) continue;
                int[] groupCount = count(i, second, first, false, 0);
//                out.println(Arrays.toString(groupCount));
//                out.println(Arrays.toString(first));

                int minGroup = (groupCount[0] < groupCount[1]) ? 0 : 1;
                total += groupCount[minGroup];
                count(i, second, first, true, minGroup);
            }
            out.println(total);
            out.println(res);
        }

        out.close();
    }

    static int[] count(int i, int[] second, int[] first, boolean setGroup, int minG) {
        int[] groupCount = new int[]{1, 0};
        int group = 0;
        int nxtNum = second[i];
        int[] ps = pos.get(second[i]);
        int idx = ps[0] == i ? ps[1] : ps[0];
        if (setGroup) {
            if (group == minG) res.append(i + 1).append(" ");
            first[i] = -1;
        }
//                out.p("%d %d\n",i,idx);
        boolean isTop = false;
        while (idx != i) {
            if (isTop) {
                if (second[idx] != nxtNum) {
                    group = (group == 0) ? 1 : 0;
                    isTop = false;
                }
            } else {
                if (first[idx] != nxtNum) {
                    group = (group == 0) ? 1 : 0;
                    isTop = true;
                }
            }

            groupCount[group]++;
            nxtNum = isTop ? first[idx] : second[idx];
            if (setGroup) {
                if (group == minG) res.append(idx + 1).append(" ");
                first[idx] = -1;
//                out.println(nxtNum);
            }
            ps = pos.get(nxtNum);
            if (ps != null) idx = ps[0] == idx ? ps[1] : ps[0];
        }
        return groupCount;
    }

    static class FastWriter {
        private static final int IO_BUFFERS = 128 * 1024;
        private final StringBuilder out;

        public FastWriter() {
            out = new StringBuilder(IO_BUFFERS);
        }

        public FastWriter p(Object object) {
            out.append(object);
            return this;
        }

        public FastWriter p(String format, Object... args) {
            out.append(String.format(format, args));
            return this;
        }

        public FastWriter println(Object object) {
            out.append(object).append("\n");
            return this;
        }

        public void close() throws IOException {
            System.out.print(out);
        }
    }

    static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

        long longNext() throws IOException {
            return Long.parseLong(next());
        }

        int intNext() throws IOException {
            return Integer.parseInt(next());
        }

        double doubleNext() throws IOException {
            return Double.parseDouble(next());
        }

        char charNext() throws IOException {
            return next().charAt(0);
        }

        public int[] nextIntArray(final int n) throws IOException {
            final int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                int num = intNext();
                a[i] = num;
                if (pos.containsKey(num)) {
                    int[] position = pos.get(num);
                    if (position[1] != -1) isInvalid = true;
                    else position[1] = i;
                } else {
                    pos.put(num, new int[]{i, -1});
                }
            }
            return a;
        }

        public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = longNext();
            return a;
        }

        String line() throws IOException {
            return br.readLine().trim();
        }
    }

    static class util {
        public static int upperBound(long[] array, long obj) {
            int l = 0, r = array.length - 1;
            while (r - l >= 0) {
                int c = (l + r) / 2;
                if (obj < array[c]) {
                    r = c - 1;
                } else {
                    l = c + 1;
                }
            }
            return l;
        }

        public static int upperBound(ArrayList<Long> array, long obj) {
            int l = 0, r = array.size() - 1;
            while (r - l >= 0) {
                int c = (l + r) / 2;
                if (obj < array.get(c)) {
                    r = c - 1;
                } else {
                    l = c + 1;
                }
            }
            return l;
        }

        public static int lowerBound(long[] array, long obj) {
            int l = 0, r = array.length - 1;
            while (r - l >= 0) {
                int c = (l + r) / 2;
                if (obj <= array[c]) {
                    r = c - 1;
                } else {
                    l = c + 1;
                }
            }
            return l;
        }

        public static int lowerBound(ArrayList<Long> array, long obj) {
            int l = 0, r = array.size() - 1;
            while (r - l >= 0) {
                int c = (l + r) / 2;
                if (obj <= array.get(c)) {
                    r = c - 1;
                } else {
                    l = c + 1;
                }
            }
            return l;
        }

        public static void print(long[] arr) {
            System.out.println(Arrays.toString(arr));
        }

        public static void print(int[] arr) {
            System.out.println(Arrays.toString(arr));
        }

        public static void print(char[] arr) {
            System.out.println(Arrays.toString(arr));
        }

        static <T> T[][] deepCopy(T[][] matrix) {
            return Arrays.stream(matrix).map(el -> el.clone()).toArray($ -> matrix.clone());
        }

        static int[][] deepCopy(int[][] matrix) {
            return Arrays.stream(matrix).map(int[]::clone).toArray($ -> matrix.clone());
        }
    }

    static class Tuple implements Comparable<Tuple> {
        int a;
        int b;

        public Tuple(int a, int b) {
            this.a = a;
            this.b = b;
        }

        public int getA() {
            return a;
        }

        public int getB() {
            return b;
        }

        public int compareTo(Tuple other) {
            if (this.a == other.a) return Integer.compare(this.b, other.b);
            return Integer.compare(this.a, other.a);
        }

        @Override
        public int hashCode() {
            return Arrays.deepHashCode(new Integer[]{a, b});
        }

        @Override
        public boolean equals(Object o) {
            if (!(o instanceof Tuple)) return false;
            Tuple pairo = (Tuple) o;
            return (this.a == pairo.a && this.b == pairo.b);
        }

        @Override
        public String toString() {
            return String.format("%d,%d  ", this.a, this.b);
        }
    }
}
