#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * w;
}
int T, N, u, x;
int A[1000005], b[1000005], v[1000005];
vector<int> V;
int main() {
  T = read();
  for (int i = 1; i <= T; i++) {
    N = read();
    V.clear();
    for (int j = 1; j <= N; j++) {
      A[j] = read();
      v[j] = j - A[j];
      b[j] = 0;
    }
    u = 1;
    while (!b[u]) {
      b[u] = 1;
      u = v[u];
    }
    V.push_back(u);
    u = v[u];
    while (u != V[0]) {
      V.push_back(u);
      u = v[u];
    }
    x = V.size();
    printf("%d\n", x);
    for (int j = 0; j < x; j++) {
      printf("%d ", V[j]);
    }
    for (int j = 1; j <= N; j++) {
      A[j] = b[j] = v[j] = 0;
    }
  }
  return 0;
}
