#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  vector<int> v(int(1e6) + 10);
  vector<bool> mark(int(1e6) + 10);
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> v[i];
    int atual = 1;
    for (int i = 1; i <= n; i++) mark[i] = 0;
    while (!mark[atual]) {
      mark[atual] = 1;
      atual -= v[atual];
    }
    vector<int> ans;
    ans.push_back(atual);
    int novoAtual = atual - v[atual];
    int cont = 1;
    while (novoAtual != atual) {
      cont++;
      ans.push_back(novoAtual);
      novoAtual -= v[novoAtual];
    }
    printf("%d\n", cont);
    for (auto it : ans) printf("%d ", (int)it);
    printf("\n");
  }
  return 0;
}
