#include <bits/stdc++.h>
using namespace std;
int t, n, bt[1000001] = {}, ar[1000001] = {};
vector<int> v;
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> ar[i];
      ar[i] = i - ar[i];
      bt[i] = 0;
    }
    int x = 0;
    while (!bt[x]) {
      v.push_back(x);
      bt[x] = v.size();
      x = ar[x];
    }
    cout << v.size() - bt[x] + 1 << "\n";
    for (int i = bt[x] - 1; i < v.size(); i++) {
      cout << v[i] + 1;
      if (i < v.size() - 1) {
        cout << " ";
      }
    }
    cout << "\n";
    v.clear();
  }
  return 0;
}
