#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int t, n, a[N], to[N];
bool vis[N];
vector<int> ans;
int main() {
  scanf("%d", &t);
  while (t--) {
    ans.clear();
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      to[i] = i - a[i];
      vis[i] = 0;
    }
    int x = 1;
    while (!vis[x]) {
      vis[x] = 1;
      x = to[x];
    }
    ans.push_back(x);
    x = to[x];
    while (x != ans[0]) {
      ans.push_back(x);
      x = to[x];
    }
    printf("%d\n", ans.size());
    for (int j = 0; j < ans.size(); j++) printf("%d ", ans[j]);
    printf("\n");
  }
  return 0;
}
