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 t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    int c = 0;
    int ans = 0;
    int mx = 0;
    bool check = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (i != 0) {
        if (a[i] != a[i - 1]) {
          check = 1;
        }
      }
      mx = max(a[i], mx);
    }
    if (a[0] == mx && a[1] != mx) {
      ans = 0;
    } else if (a[n - 1] == mx && a[n - 2] != mx) {
      ans = n - 1;
    } else {
      for (int i = 1; i < n - 1; i++) {
        if (a[i] == mx) {
          if (a[i + 1] != mx || a[i - 1] != mx) {
            ans = i;
            break;
          }
        }
      }
    }
    if (check) {
      cout << ans + 1 << endl;
    } else {
      cout << -1 << endl;
    }
  }
}
