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>
template <class t>
inline void read(t &s) {
  s = 0;
  register int f = 1;
  register char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  s *= f;
  return;
}
template <class t, class... A>
inline void read(t &x, A &...a) {
  read(x);
  read(a...);
}
template <class t>
inline void write(t x) {
  if (x < 0) putchar('-'), x = -x;
  int buf[21], top = 0;
  while (x) buf[++top] = x % 10, x /= 10;
  if (!top) buf[++top] = 0;
  while (top) putchar(buf[top--] ^ '0');
  return;
}
inline void setIn(std::string s) {
  freopen(s.c_str(), "r", stdin);
  return;
}
inline void setOut(std::string s) {
  freopen(s.c_str(), "w", stdout);
  return;
}
inline void setIO(std::string s = "") {
  setIn(s + ".in");
  setOut(s + ".out");
  return;
}
template <class t>
inline bool ckmin(t &x, t y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
template <class t>
inline bool ckmax(t &x, t y) {
  if (x < y) {
    x = y;
    return 1;
  }
  return 0;
}
inline int lowbit(int x) { return x & (-x); }
const int MaxN = 4e5 + 50;
std::vector<int> E[MaxN], G[MaxN];
int dfn[MaxN], low[MaxN], vis[MaxN], sta[MaxN], top, dfncnt;
int col[MaxN], scc;
int a[3][MaxN], pos[MaxN], cnt[MaxN];
inline void tarjan(int u) {
  dfn[u] = low[u] = ++dfncnt;
  sta[top++] = u, vis[u] = 1;
  for (auto v : E[u])
    if (!dfn[v])
      tarjan(v), ckmin(low[u], low[v]);
    else if (vis[v])
      ckmin(low[u], dfn[v]);
  if (dfn[u] == low[u]) {
    ++scc;
    do vis[sta[--top]] = 0, col[sta[top]] = scc;
    while (sta[top] != u);
  }
}
inline void work() {
  int n;
  read(n);
  std::memset(dfn, 0, sizeof(int) * ((n + 1) << 1));
  std::memset(low, 0, sizeof(int) * ((n + 1) << 1));
  std::memset(vis, 0, sizeof(int) * ((n + 1) << 1)), top = dfncnt = 0;
  std::memset(col, 0, sizeof(int) * ((n + 1) << 1)), scc = 0;
  std::memset(pos, 0, sizeof(int) * ((n + 1) << 1));
  std::memset(cnt, 0, sizeof(int) * ((n + 1) << 1));
  for (int i = 1; i <= (n << 1); ++i) E[i].clear(), G[i].clear();
  for (int i = 1; i <= 2; ++i)
    for (int j = 1; j <= n; ++j)
      read(a[i][j]), pos[a[i][j]] ^= j, ++cnt[a[i][j]];
  for (int i = 1; i <= n; ++i)
    if (cnt[i] != 2) return std::puts("-1"), void();
  for (int i = 1; i <= n; ++i) {
    register int x = a[1][i];
    if (pos[x]) {
      register int nxt = (pos[x] ^ i);
      if (a[1][nxt] == x)
        E[i].push_back(nxt + n), E[i + n].push_back(nxt);
      else
        E[i].push_back(nxt), E[i + n].push_back(nxt + n);
    }
    x = a[2][i];
    if (pos[x]) {
      register int nxt = (pos[x] ^ i);
      if (a[2][nxt] == x)
        E[i].push_back(nxt + n), E[i + n].push_back(nxt);
      else
        E[i].push_back(nxt), E[i + n].push_back(nxt + n);
    }
  }
  for (int i = 1; i <= (n << 1); ++i)
    if (!dfn[i]) tarjan(i);
  for (int i = 1; i <= n; ++i)
    if (col[i] == col[i + n]) return std::puts("-1"), void();
  for (int i = 1; i <= (n << 1); ++i) G[col[i]].push_back(i);
  std::vector<int> ans;
  for (int i = 1; i <= n; ++i)
    if ((int)G[col[i]].size()) {
      register int c1 = 0, c2 = 0;
      for (auto j : G[col[i]]) c1 += j > n;
      for (auto j : G[col[i + n]]) c2 += j > n;
      if (c1 < c2) {
        for (auto j : G[col[i]])
          if (j > n) ans.push_back(j - n);
      } else {
        for (auto j : G[col[i + n]])
          if (j > n) ans.push_back(j - n);
      }
      G[col[i]].clear(), G[col[i + n]].clear();
    }
  write((int)ans.size()), std::puts("");
  for (auto i : ans) write(i), std::putchar(32);
  std::puts("");
}
signed main(void) {
  int t;
  read(t);
  while (t--) work();
  return 0;
}
