#include <bits/stdc++.h>
using namespace std;
int n;
int a[1000005];
bool used[1000005];
int f[1000005];
int main() {
  int t;
  cin >> t;
  while (t--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      used[i] = 0;
      f[i] = i - a[i];
    }
    int now = 1;
    while (used[now] == 0) {
      used[now] = 1;
      now = f[now];
    }
    int s = now;
    now = f[now];
    vector<int> ans;
    ans.push_back(s);
    while (now != s) {
      ans.push_back(now);
      now = f[now];
    }
    printf("%d\n", ans.size());
    for (int x : ans) printf("%d ", x);
    printf("\n");
  }
  return 0;
}
