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;
int main(int argc, char** argv) {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long int tt, mi = -1, mx = -1, mxi = 0;
    for (int i = 0; i < n; i++) {
      cin >> tt;
      if (i) {
        if (mx < tt) {
          mxi = i;
          mx = tt;
        }
        mi = min(mi, tt);
      } else {
        mx = mi = tt;
      }
    }
    cout << ((mi == mx) ? (long long int)-1 : mxi) << endl;
  }
}
