#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\n";
  err(++it, args...);
}
const double PI = acos(-1);
const double eps = (1e-9);
const long long int INF = 1e18;
const int M = (1e9) + 7;
const int N = (1e6) + 5;
vector<vector<int> > ad;
int vis[N];
stack<int> st;
int cycle;
vector<int> ans;
void dfs(int s) {
  if (vis[s] == 0) {
    st.push(s);
    vis[s] = 1;
    int i, a, x = ad[s].size();
    for (i = 0; i < x; i++) {
      dfs(ad[s][i]);
      if (cycle) return;
    }
    vis[s] = 2;
    st.pop();
    return;
  }
  if (vis[s] == 1) {
    while (st.top() != s) ans.emplace_back(st.top()), st.pop();
    ans.emplace_back(st.top()), st.pop();
    cycle = 1;
    return;
  }
}
void solve() {
  int i, n, a;
  scanf("%d", &n);
  ad.resize(n + 1);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a);
    ad[i].emplace_back(i - a);
    vis[i] = 0;
  }
  cycle = 0;
  ans.clear();
  dfs(1);
  while (!st.empty()) st.pop();
  ad.clear();
  n = ans.size();
  printf("%d\n", n);
  for (i = 0; i < n; i++) printf("%d ", ans[i]);
  printf("\n");
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) solve();
}
