#include <bits/stdc++.h>
using namespace std;
int n, top, ns, a[1000010], to[1000010], v[1000010], z[1000010], s[1000010];
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int main() {
  int T;
  T = read();
  while (T--) {
    ns = 0, n = read();
    for (int i = 1; i <= n; i++)
      a[i] = read(), to[i] = a[i] = i - a[i], v[i] = 0;
    int p = 1, top = 0;
    while (!v[p]) z[++top] = p, v[p] = 1, p = to[p];
    do {
      s[++ns] = z[top];
    } while (z[top--] != p);
    printf("%d ", ns);
    for (int i = 1; i <= ns; i++) printf("%d ", s[i]);
    printf("\n");
  }
}
