#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 2, mod = 1e9 + 7, inf = mod;
vector<int> ans;
int a[maxn], h[maxn], par[maxn], n, f, b[maxn];
bool mark[maxn];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t, v;
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      b[i] = i - a[i];
      par[i] = 0, mark[i] = 0;
    }
    v = 1;
    while (!mark[v]) {
      par[b[v]] = v;
      mark[v] = 1;
      v = b[v];
    }
    int t = b[v];
    while (v != t) {
      ans.push_back(t);
      t = b[t];
    }
    cout << ans.size() + 1 << "\n";
    for (int i = 0; i < ans.size(); i++) {
      cout << ans[i] << " ";
    }
    cout << t << "\n";
    ans.clear();
  }
}
