#include <bits/stdc++.h>
using namespace std;
int t, n, fl, tot, t1, q[1000005], hd[1000005], to[1000005], nxt[1000005],
    v[1000005];
int read() {
  int x = 0, fl = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') fl = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * fl;
}
void add(int x, int y) {
  tot++;
  to[tot] = y;
  nxt[tot] = hd[x];
  hd[x] = tot;
  return;
}
void dfs(int x) {
  if (fl) return;
  v[x]++;
  if (v[x] > 1) {
    fl = 1;
    int fi = 0;
    for (int i = 1; i <= t1; i++)
      if (q[i] == x) {
        fi = i;
        break;
      }
    printf("%d\n", t1 - fi + 1);
    for (int i = fi; i <= t1; i++) printf("%d ", q[i]);
    putchar('\n');
    return;
  }
  q[++t1] = x;
  for (int i = hd[x]; i; i = nxt[i]) dfs(to[i]);
  v[x]--;
  t1--;
  return;
}
int main() {
  t = read();
  while (t--) {
    n = read();
    fl = 0;
    for (int i = 1; i <= n; i++) {
      int x = read();
      add(i, i - x);
    }
    for (int i = 1; i <= n; i++) {
      dfs(i);
      if (fl) break;
    }
    for (int i = 1; i <= n; i++) v[i] = hd[i] = 0;
    tot = 0;
  }
  return 0;
}
