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>
int a[300005];
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    int max = 0, maxi = 0;
    int cnt = 0;
    int flag = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (max < a[i]) {
        max = a[i];
        maxi = i;
      }
    }
    for (int i = 0; i < n - 1; i++) {
      if (a[i] == a[i + 1])
        flag = 1;
      else {
        flag = 0;
        break;
      }
    }
    if (flag) {
      cout << "-1" << endl;
    } else {
      for (int i = maxi; i < n; i++) {
        if (i == 0) {
          if (a[i] > a[i + 1]) {
            cout << i + 1 << endl;
            break;
          }
        }
        if (i > 0 && i < n - 1) {
          if (a[i] > a[i + 1] || a[i] > a[i - 1]) {
            cout << i + 1 << endl;
            break;
          }
        }
        if (i == n - 1) cout << i + 1 << endl;
      }
    }
  }
  return 0;
}
