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 g;
  cin >> g;
  int c[g];
  int n, x, l;
  for (int i = 0; i < g; i++) {
    cin >> n;
    int a[n];
    for (int j = 0; j < n; j++) {
      cin >> a[j];
    }
    x = a[0];
    for (int j = 1; j < n; j++) {
      if (a[j] > x) {
        x = a[j];
      }
    }
    if ((a[0] == x) && (a[1] != x)) {
      c[i] = 0;
      continue;
    }
    if ((a[n - 1] == x) && (a[n - 2] != x)) {
      c[i] = n - 1;
      continue;
    }
    l = x + 1;
    for (int j = 1; j < n - 1; j++) {
      if ((a[j] == x) && (a[j - 1] != x || a[j + 1] != x)) {
        l = j;
      }
    }
    if (l != x + 1) {
      c[i] = l + 1;
    } else {
      c[i] = -1;
    }
  }
  for (int i = 0; i < g; i++) {
    cout << c[i] << endl;
  }
}
