#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 101;
int n, x, T, t[N], vis[N];
vector<int> ans;
int main() {
  scanf("%d", &T);
  while (T--) {
    ans.clear();
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &x);
      t[i] = i - x;
      vis[i] = 0;
    }
    x = 1;
    while (!vis[x]) {
      vis[x] = 1;
      x = t[x];
    }
    ans.push_back(x);
    x = t[x];
    while (x != ans[0]) {
      ans.push_back(x);
      x = t[x];
    }
    printf("%d\n", ans.size());
    for (int j = 0; j < ans.size(); j++) {
      printf("%d ", ans[j]);
    }
    printf("\n");
  }
  return 0;
}
