#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
const long long MAXN = 1e6 + 10;
vector<int> ans;
vector<bool> used(MAXN, false);
int gg[MAXN];
int stop = 0;
void dfs(int v) {
  if (stop) {
    if (v == stop) return;
    ans.push_back(v);
    dfs(v - gg[v]);
  } else {
    if (used[v]) {
      stop = v;
      ans.push_back(v);
      dfs(v - gg[v]);
    } else {
      used[v] = true;
      dfs(v - gg[v]);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    ans.clear();
    stop = 0;
    int n;
    cin >> n;
    fill(used.begin(), used.begin() + n + 5, false);
    for (int i = 0; i < n; ++i) {
      cin >> gg[i + 1];
    }
    dfs(1);
    cout << ans.size() << "\n";
    for (int to : ans) {
      cout << to << " ";
    }
    cout << "\n";
  }
  return 0;
}
