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
#include <bits/stdc++.h>
using namespace std;
bool checkCounts(int n, vector<int> &a1, vector<int> &a2) {
  vector<int> counts(n + 1, 0);
  for (int elem : a1) counts[elem]++;
  for (int elem : a2) counts[elem]++;
  for (int i = (1); i <= (n); i++) {
    if (counts[i] != 2) return false;
  }
  return true;
}
void printFail() {
  cout << "-1"
       << "\n";
}
void printSolution(vector<int> &flip) {
  int k = 0;
  for (int elem : flip) {
    k += elem;
  }
  cout << k << "\n";
  for (int i = 0; i < (flip.size()); i++) {
    if (flip[i] == 1) cout << (i + 1) << " ";
  }
  cout << "\n";
}
vector<pair<int, int>> getEqualConstraints(vector<int> &a1, vector<int> &a2) {
  int n = a1.size();
  vector<tuple<int, int, int>> positions;
  positions.reserve(2 * n);
  for (int i = 0; i < (n); i++) {
    positions.push_back({a1[i], i, 0});
    positions.push_back({a2[i], i, 1});
  }
  sort(positions.begin(), positions.end());
  vector<pair<int, int>> result;
  for (int i = 0; i < (n); i++) {
    int ignore, i1, i2, y1, y2;
    tie(ignore, i1, y1) = positions[2 * i];
    tie(ignore, i2, y2) = positions[2 * i + 1];
    if (i1 != i2 && y1 != y2) result.push_back({i1, i2});
  }
  return result;
}
vector<pair<int, int>> getUnequalConstraints(vector<int> &a1, vector<int> &a2) {
  int n = a1.size();
  vector<tuple<int, int, int>> positions;
  positions.reserve(2 * n);
  for (int i = 0; i < (n); i++) {
    positions.push_back({a1[i], i, 0});
    positions.push_back({a2[i], i, 1});
  }
  sort(positions.begin(), positions.end());
  vector<pair<int, int>> result;
  for (int i = 0; i < (n); i++) {
    int ignore, i1, i2, y1, y2;
    tie(ignore, i1, y1) = positions[2 * i];
    tie(ignore, i2, y2) = positions[2 * i + 1];
    if (i1 != i2 && y1 == y2) result.push_back({i1, i2});
  }
  return result;
}
vector<vector<int>> pairs_to_adjlist(int n, vector<pair<int, int>> &pairs) {
  vector<vector<int>> result(n);
  for (auto p : pairs) {
    int i, j;
    tie(i, j) = p;
    result[i].push_back(j);
    result[j].push_back(i);
  }
  return result;
}
void dfs1(int node, int color, vector<int> &colors, vector<vector<int>> &adj) {
  colors[node] = color;
  for (int neighbor : adj[node]) {
    if (colors[neighbor] != -1) continue;
    dfs1(neighbor, color, colors, adj);
  }
}
vector<int> getGroups(int n, vector<vector<int>> &adj) {
  vector<int> result(n, -1);
  int component = 0;
  for (int i = 0; i < (n); i++) {
    if (result[i] == -1) {
      dfs1(i, component++, result, adj);
    }
  }
  return result;
}
bool color_bipartite(int node, int color, vector<int> &colors,
                     vector<vector<int>> &adj) {
  colors[node] = color;
  for (int neighbor : adj[node]) {
    if (colors[neighbor] == -1) {
      color_bipartite(neighbor, 1 - color, colors, adj);
    } else if (colors[neighbor] == color)
      return false;
  }
  return true;
}
vector<int> getMinimumBipartiteColoring(int n, vector<int> &vertexSize,
                                        vector<pair<int, int>> &edges) {
  vector<vector<int>> adj = pairs_to_adjlist(n, edges);
  vector<int> componentIds = getGroups(n, adj);
  int k = 1 + *max_element(componentIds.begin(), componentIds.end());
  bool fail = false;
  vector<int> color(n, -1);
  for (int i = 0; i < (n); i++) {
    if (color[i] == -1) {
      fail |= !color_bipartite(i, 0, color, adj);
    }
  }
  vector<int> componentSums(k, 0);
  vector<int> componentColorSums(k, 0);
  for (int i = 0; i < (n); i++) {
    componentSums[componentIds[i]] += vertexSize[i];
    if (color[i] == 1) componentColorSums[componentIds[i]] += vertexSize[i];
  }
  vector<bool> swapQ(k);
  for (int i = 0; i < (k); i++) {
    swapQ[i] =
        (componentSums[i] - componentColorSums[i]) < (componentColorSums[i]);
  }
  for (int i = 0; i < (n); i++) {
    color[i] = swapQ[componentIds[i]] ? (1 - color[i]) : color[i];
  }
  if (fail) color[0] = -10;
  return color;
}
void testcase() {
  int n;
  cin >> n;
  vector<int> a1(n);
  for (int i = 0; i < (n); i++) cin >> a1[i];
  vector<int> a2(n);
  for (int i = 0; i < (n); i++) cin >> a2[i];
  if (!checkCounts(n, a1, a2)) {
    printFail();
    return;
  }
  vector<pair<int, int>> equal = getEqualConstraints(a1, a2);
  vector<pair<int, int>> unequal = getUnequalConstraints(a1, a2);
  vector<vector<int>> eq_adj = pairs_to_adjlist(n, equal);
  vector<int> largeVertexId = getGroups(n, eq_adj);
  int k = 1 + *max_element(largeVertexId.begin(), largeVertexId.end());
  vector<pair<int, int>> lvertexUnequal;
  lvertexUnequal.reserve(unequal.size());
  for (auto uneq : unequal) {
    int i, j;
    tie(i, j) = uneq;
    if (largeVertexId[i] == largeVertexId[j]) {
      printFail();
      return;
    } else {
      lvertexUnequal.push_back({largeVertexId[i], largeVertexId[j]});
    }
  }
  vector<int> vertexSize(k, 0);
  for (int i = 0; i < (n); i++) vertexSize[largeVertexId[i]]++;
  vector<int> color =
      getMinimumBipartiteColoring(k, vertexSize, lvertexUnequal);
  if (color[0] == -10) {
    printFail();
    return;
  }
  vector<int> color2(n);
  for (int i = 0; i < (n); i++) color2[i] = color[largeVertexId[i]];
  printSolution(color2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T;
  cin >> T;
  for (int tc = 0; tc < (T); tc++) testcase();
  return 0;
}
