#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<int> numbers(n);
    vector<int> trayectoria(n + 1);
    for (int &i : numbers) cin >> i;
    if (numbers[0] == 1) {
      cout << n + 1 << " ";
      for (int i = 1; i < n + 1; i++) cout << i << " ";
      cout << "\n";
    } else if (numbers[n - 1] == 0) {
      for (int i = 1; i < n; i++) cout << i << " ";
      cout << n << " " << n + 1 << " ";
      cout << "\n";
    } else {
      bool poss = false;
      for (int i = 0; i < n; i++) {
        if (i < n - 1 && numbers[i] < numbers[i + 1]) {
          for (int j = 0; j < i; j++) cout << j + 1 << " ";
          cout << i + 1 << " " << n + 1 << " ";
          for (int j = i + 1; j < n; j++) cout << j + 1 << " ";
          cout << endl;
          poss = true;
          break;
        }
      }
      if (!poss) cout << "-1\n";
    }
  }
}
