#include <bits/stdc++.h>
using namespace std;
int a[1000005], vis[1000005];
int main() {
  int T, n;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%d", a + i);
      a[i] = i - a[i];
      vis[i] = 0;
    }
    vector<int> s, b;
    s.push_back(1);
    while (!vis[s.back()]) {
      vis[s.back()] = 1;
      s.push_back(a[s.back()]);
    }
    int j = s.back();
    s.pop_back();
    b.push_back(j);
    while (!s.empty() && s.back() != j) b.push_back(s.back()), s.pop_back();
    printf("%d\n", b.size());
    for (int i : b) printf("%d ", i);
    printf("\n");
  }
  return 0;
}
