1
3
5 3 4
 6
5
5 3 4 4 5
3
1 1 1
5
4 4 3 4 4
5
5 5 4 3 2
3
1 1 2
5
5 4 3 5 5
 1
3
10 1 5

1
 1
-1
2
2
3
1
 1

#include <bits/stdc++.h>
using namespace std;
long long dp[105][105];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    unordered_set<long long> st;
    for (auto &i : a) {
      cin >> i;
      st.insert(i);
    }
    if (n == 2) {
      if (a[0] > a[1]) {
        cout << 1 << endl;
      } else if (a[1] > a[0]) {
        cout << 2 << endl;
      } else {
        cout << -1 << endl;
      }
      continue;
    }
    long long check = a[0] + n - 1;
    long long vzlom_jopi = a[0];
    long long cnt = 0;
    long long vzlom_jopi_ind = 0;
    for (long long i = 1; i < n; i++) {
      if (a[i] < vzlom_jopi) {
        vzlom_jopi += cnt + 1;
        cnt = 0;
      } else {
        if (a[i] != vzlom_jopi) {
          vzlom_jopi = a[i] + 1;
          vzlom_jopi_ind = i;
        } else {
          vzlom_jopi_ind = i;
          cnt += 1;
        }
      }
    }
    cout << (check == vzlom_jopi ? vzlom_jopi_ind + 1 : -1) << endl;
  }
}
