#include <bits/stdc++.h>
const int INF = 2000000005;
const long long BIG_INF = 2000000000000000005;
const int mod = 1000000007;
const int P = 31;
const long double PI = 3.141592653589793238462643;
const double eps = 1e-9;
using namespace std;
vector<pair<int, int> > dir = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
bool valid(int x, int y, int n, int m) {
  return x >= 0 && y >= 0 && x < n && y < m;
}
mt19937 rng(1999999973);
int a[1000000 + 50];
bool vis[1000000 + 50];
signed main() {
  ios_base::sync_with_stdio(0);
  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];
    }
    int root = 1;
    while (!vis[root]) {
      vis[root] = true;
      root = root - a[root];
    }
    int cur = root;
    vector<int> ans;
    do {
      ans.push_back(cur);
      cur = cur - a[cur];
    } while (cur != root);
    cout << ans.size() << '\n';
    for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
    cout << '\n';
    for (int i = 1; i <= n; i++) vis[i] = false;
  }
  return 0;
}
