#include <bits/stdc++.h>
using namespace std;
bool dfs(int v, vector<int>& ans, vector<int>& vis,
         const vector<vector<int>>& adj) {
  if (vis[v]) {
    reverse(ans.begin(), ans.end());
    while (ans.back() != v) ans.pop_back();
    return true;
  }
  vis[v] = 1;
  ans.push_back(v);
  for (int x : adj[v]) {
    auto res = dfs(x, ans, vis, adj);
    if (res) return true;
  }
  ans.pop_back();
  return false;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    vector<vector<int>> adj(n + 1);
    for (int i = 1; i <= n; i++) {
      int x;
      cin >> x;
      adj[i].push_back(i - x);
    }
    vector<int> ans;
    vector<int> vis(n + 1, 0);
    for (int i = 1; i <= n; i++)
      if (!vis[i]) {
        auto res = dfs(i, ans, vis, adj);
        if (res) break;
      }
    cout << ans.size() << "\n";
    for (int x : ans) cout << x << " ";
    cout << "\n";
  }
  return 0;
}
