#include <bits/stdc++.h>
using namespace std;
void solve_case() {
  int N;
  cin >> N;
  vector<int> a(N + 1);
  for (int i = 1; i <= N; ++i) {
    cin >> a[i];
  }
  vector<bool> vis(N + 1, false);
  vector<int> indices;
  int cur = 1;
  while (true) {
    if (vis[cur]) {
      break;
    }
    vis[cur] = true;
    indices.push_back(cur);
    cur = cur - a[cur];
  }
  int k = indices.size() - 1;
  while (indices[k] != cur) k--;
  cout << indices.size() - k << "\n";
  for (int i = k; i < indices.size(); ++i) {
    cout << indices[i] << (i == indices.size() - 1 ? "\n" : " ");
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T-- > 0) {
    solve_case();
  }
  return 0;
}
