#include <bits/stdc++.h>
template <class T>
inline T read() {
  T r = 0, f = 0;
  char c;
  while (!isdigit(c = getchar())) f |= (c == '-');
  while (isdigit(c)) r = (r << 1) + (r << 3) + (c ^ 48), c = getchar();
  return f ? -r : r;
}
struct E {
  int v, nxt;
  E() {}
  E(int v, int nxt) : v(v), nxt(nxt) {}
} e[1001001 << 1];
int n, s_e, head[1001001];
inline void a_e(int u, int v) {
  e[++s_e] = E(v, head[u]);
  head[u] = s_e;
}
bool vis[1001001];
int s, s_ans, ans[1001001];
bool dfs(int u) {
  vis[u] = 1;
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (vis[v]) {
      ans[++s_ans] = v;
      ans[++s_ans] = u;
      return true;
    }
    if (dfs(v)) {
      if (u == ans[1]) s = s_ans;
      ans[++s_ans] = u;
      return true;
    }
  }
  return false;
}
inline void work() {
  s_e = 0;
  for (int i = 1; i <= n; i++) head[i] = 0, vis[i] = 0;
  n = read<int>();
  int U = 0;
  for (int i = 1; i <= n; i++) {
    int v = i - read<int>();
    if (i == v) U = i;
    a_e(i, v);
  }
  if (U) {
    printf("1\n%d\n", U);
    return;
  }
  s_ans = 0;
  for (int i = 1; i <= n; i++)
    if (dfs(i)) {
      printf("%d\n", s);
      for (int j = 1; j <= s; j++) printf("%d ", ans[j]);
      puts("");
      break;
    }
}
int main() {
  int t = read<int>();
  while (t--) work();
  return 0;
}
