#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
using ld = long double;
ll mod = 998244353;
ll gcd(ll a, ll b) {
  if (a == 0 or b == 0) return a + b;
  return gcd(b, a % b);
}
ll sum(ll a, ll b) {
  a += b;
  a %= mod;
  return a;
}
ll sub(ll a, ll b) {
  a += mod - b;
  a %= mod;
  return a;
}
inline ll mul(ll a, ll b) {
  if (a * b < mod) return a * b;
  return a * b % mod;
}
inline ll pew(ll a, ll b) {
  ll res = 1;
  while (b) {
    if (b & 1) res = mul(res, a);
    a = mul(a, a);
    b /= 2;
  }
  return res;
}
int parent[600001];
int rnk[600001];
int suk[600001];
void make_set(int v) {
  parent[v] = v;
  rnk[v] = 0;
  suk[v] = 0;
}
int find_set(int v) {
  if (v == parent[v]) return v;
  return parent[v] = find_set(parent[v]);
}
void union_sets(int a, int b) {
  a = find_set(a);
  b = find_set(b);
  if (a != b and (suk[a] * suk[b] == 0)) {
    if (rnk[a] < rnk[b]) swap(a, b);
    parent[b] = a;
    if (rnk[a] == rnk[b]) ++rnk[a];
    suk[a] += suk[b];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ll t;
  cin >> t;
  while (t--) {
    ll n;
    cin >> n;
    vector<ll> a(n);
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      a[i] = i - a[i];
    }
    vector<ll> flag(n);
    ll cur = 0;
    vector<ll> ord(n);
    ll pos = 0;
    vector<ll> ans(n);
    ll k = 0;
    while (true) {
      if (flag[cur] == 0) {
        flag[cur] = 1;
        ord[pos] = cur;
        pos++;
        cur = a[cur];
      } else {
        ans[k] = cur;
        k++;
        pos--;
        while (ord[pos] != cur) {
          ans[k] = ord[pos];
          pos--;
          k++;
        }
        break;
      }
    }
    cout << k << "\n";
    for (int i = 0; i < k; i++) {
      cout << ans[i] + 1 << " ";
    }
    cout << "\n";
  }
}
