#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    int ar[n];
    for (int i = 0; i < n; i++) {
      scanf("%d", ar + i);
      ar[i] = i - ar[i];
    }
    int start = 0;
    for (int i = 0; i < n; i++) start = ar[start];
    vector<int> sets;
    int temp = start;
    do {
      sets.push_back(temp);
      temp = ar[temp];
    } while (temp != start);
    printf("%d\n", sets.size());
    for (int i = 0; i < sets.size(); i++) printf("%d ", sets[i] + 1);
    printf("\n");
  }
}
