#include <bits/stdc++.h>
using namespace std;
inline char nc() {
  static char buf[100000], *l = buf, *r = buf;
  return l == r && (r = (l = buf) + fread(buf, 1, 100000, stdin), l == r)
             ? EOF
             : *l++;
}
template <class T>
void read(T &x) {
  x = 0;
  int f = 1, ch = nc();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = nc();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 - '0' + ch;
    ch = nc();
  }
  x *= f;
}
const int maxn = 1e6 + 50;
int n;
int T;
int a[maxn];
bool vis[maxn];
vector<int> R;
vector<int> an;
void dfs(int u) {
  if (vis[u]) return;
  vis[u] = 1;
  R.push_back(u);
  dfs(u - a[u]);
}
int main() {
  read(T);
  for (int kase = 1; kase <= T; ++kase) {
    read(n);
    for (int i = 1; i <= n; ++i) {
      read(a[i]);
    }
    dfs(1);
    long long sum = 0;
    for (int i = R.size() - 1; ~i; --i) {
      sum += a[R[i]];
      an.push_back(R[i]);
      if (sum == 0) break;
    }
    printf("%d\n", (int)an.size());
    for (int i = 0; i < an.size(); ++i) {
      if (i) printf(" ");
      printf("%d", an[i]);
    }
    printf("\n");
    R.clear();
    an.clear();
    for (int i = 1; i <= n; ++i) vis[i] = 0;
  }
  return 0;
}
