#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int dir[4][2] = {-1, 0, 1, 0, 0, -1, 0, 1};
int a[1000010];
bool vis[1000010];
int pos;
vector<int> res;
void dfs(int u) {
  vis[u] = true;
  if (vis[u - a[u]]) {
    for (int i = 0; i < res.size(); i++) {
      if (res[i] == u - a[u]) {
        cout << res.size() - i << "\n";
        for (int j = i; j < res.size(); j++) cout << res[j] << " ";
        cout << "\n";
        return;
      }
    }
  }
  res.push_back(u - a[u]);
  dfs(u - a[u]);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i], vis[i] = false;
    res.clear();
    res.push_back(1);
    dfs(1);
  }
  return 0;
}
