#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
using namespace std;
template <class T, class U>
inline void checkmin(T &x, U y) {
  if (y < x) x = y;
}
template <class T, class U>
inline void checkmax(T &x, U y) {
  if (y > x) x = y;
}
template <class T, class U>
inline bool ifmax(T &x, U y) {
  if (y > x) return x = y, true;
  return false;
}
template <class T, class U>
inline bool ifmin(T &x, U y) {
  if (y < x) return x = y, true;
  return false;
}
template <class T>
inline void sort(T &a) {
  sort(a.begin(), a.end());
}
template <class T>
inline void rsort(T &a) {
  sort(a.rbegin(), a.rend());
}
template <class T>
inline void reverse(T &a) {
  reverse(a.begin(), a.end());
}
template <class T, class U>
inline istream &operator>>(istream &str, pair<T, U> &p) {
  return str >> p.first >> p.second;
}
template <class T>
inline istream &operator>>(istream &str, vector<T> &a) {
  for (auto &i : a) str >> i;
  return str;
}
template <class T>
inline T sorted(T a) {
  sort(a);
  return a;
}
void read(int &x) {
  static char c;
  c = getchar();
  if (c == '-') {
    x = 0;
    while ((c = getchar()) >= '0') x = (x << 3) + (x << 1) + (c - '0');
    x = -x;
  } else {
    x = c - '0';
    while ((c = getchar()) >= '0') x = (x << 3) + (x << 1) + (c - '0');
  }
}
void print(int x) {
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}
const int N = 1e6 + 1;
int a[N], ind[N];
bool used[N];
void solve() {
  int n;
  read(n);
  for (int i = 0; i < n; ++i) read(a[i]), used[i] = 0;
  int v = 0, pind = 0;
  while (!used[v]) {
    used[v] = true;
    ind[pind++] = v;
    v -= a[v];
  }
  bool flag = false;
  for (int i = 0;; ++i)
    if (ind[i] == v) {
      print(pind - i);
      putchar('\n');
      for (int j = i; j < pind; ++j) print(ind[j] + 1), putchar(' ');
      putchar('\n');
      return;
    }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(12);
  srand(94385);
  int t;
  read(t);
  while (t--) solve();
  return 0;
}
