#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
int a[maxn];
bool mark[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie();
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      int x;
      cin >> x;
      a[i] = i - x;
      mark[i] = 0;
    }
    int tmp = 1;
    while (mark[tmp] == 0) {
      mark[tmp] = 1;
      tmp = a[tmp];
    }
    vector<int> ans;
    int tmp2 = a[tmp];
    ans.push_back(tmp);
    while (tmp2 != tmp) {
      ans.push_back(tmp2);
      tmp2 = a[tmp2];
    }
    cout << ans.size() << "\n";
    for (int x : ans) cout << x << " ";
    cout << "\n";
  }
  return 0;
}
