#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
int T;
int n, a[maxn];
int vis[maxn];
vector<int> ans;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    ans.clear();
    fill(vis, vis + n + 1, 0);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      a[i] = i - a[i];
    }
    int i;
    for (i = 1; !vis[i]; vis[i] = 1, i = a[i])
      ;
    int st = i;
    while (1) {
      ans.push_back(i);
      i = a[i];
      if (i == st) break;
    }
    printf("%d\n", (int)ans.size());
    for (int u : ans) printf("%d ", u);
    printf("\n");
  }
  return 0;
}
