#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10, mod = 1e9 + 7;
const long long inf = 1e18;
int f[maxn];
bool mark[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie();
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    for (int i = n - 1; i >= 0; i--) {
      int x;
      cin >> x;
      f[i] = i + x;
      mark[i] = 0;
    }
    int tmp = 0;
    while (mark[tmp] == 0) mark[tmp] = 1, tmp = f[tmp];
    vector<int> ans;
    int tmp2 = f[tmp];
    ans.push_back(tmp);
    while (tmp2 != tmp) ans.push_back(tmp2), tmp2 = f[tmp2];
    cout << int((ans).size()) << "\n";
    for (int x : ans) cout << (n - 1 - x) + 1 << " ";
    cout << "\n";
  }
  return 0;
}
