#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int ne[N], x, flag[N], n;
void print(int x) {
  int now = x, cnt = 0;
  while (now != x || cnt == 0) {
    now = ne[now];
    cnt++;
  }
  printf("%d\n", cnt);
  now = x;
  cnt = 0;
  while (now != x || cnt == 0) {
    printf("%d ", now);
    cnt++;
    now = ne[now];
  }
  puts("");
}
void dfs(int x) {
  flag[x] = 1;
  if (flag[ne[x]])
    print(ne[x]);
  else
    dfs(ne[x]);
}
void doit() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    ne[i] = i - x;
  }
  dfs(1);
  for (int i = 1; i <= n; i++) flag[i] = 0;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) doit();
}
