#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &x) {
  x = 0;
  int w = 0;
  char g = getchar();
  while (!isdigit(g)) {
    w |= (g == '-');
    g = getchar();
  }
  while (isdigit(g)) {
    x = (x << 3) + (x << 1) + (g xor 48);
    g = getchar();
  }
  x = w ? -x : x;
  return;
}
const int maxn = 1000010;
bool book[maxn];
int T, n, u = 1, top, cnt, tot;
int a[maxn], fa[maxn], st[maxn], ans[maxn];
int main() {
  read(T);
  while (T--) {
    read(n);
    u = 1;
    tot = cnt = 0;
    for (int i = 1; i <= n; i++) read(a[i]), fa[i] = i - a[i];
    while (!book[u]) {
      book[u] = true;
      st[++top] = u;
      u = fa[u];
    }
    while (st[top] != u) {
      book[st[top]] = false;
      ans[++cnt] = st[top--];
    }
    ans[++cnt] = st[top];
    while (top) book[st[top--]] = false;
    printf("%d\n", cnt);
    for (int i = 1; i <= cnt; i++) printf("%d ", ans[i]);
    puts("");
  }
  return 0;
}
