#include <bits/stdc++.h>
using namespace std;
int a[1000005];
bool vis[1000005];
int main() {
  int _;
  scanf("%d", &_);
  while (_--) {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
      scanf("%d", &a[i]), a[i] = i - a[i], vis[i] = 0;
    vector<int> v;
    int now = 1, tmp = 0;
    while (!vis[now]) v.push_back(now), vis[now] = 1, now = a[now];
    for (int i = 0; i < v.size(); i++)
      if (v[i] == now) {
        tmp = i;
        break;
      }
    printf("%d\n", (int)v.size() - tmp);
    for (int i = tmp; i < v.size(); i++) printf("%d ", v[i]);
    puts("");
  }
  return 0;
}
