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;
  for (int t = 1; t <= T; t++) {
    int n;
    cin >> n;
    int a[300010];
    int maxn = 0;
    int fuc = 0;
    int flag = 0;
    int flag2 = 0;
    cin >> a[1];
    for (int i = 2; i <= n - 1; i++) {
      cin >> a[i];
      if (a[i] != a[i - 1]) {
        flag = 1;
      }
      if (i >= 3) {
        if (a[i] != a[i - 1]) {
          flag2 = 1;
        }
      }
      if (a[i] > maxn) {
        fuc = i;
        maxn = a[i];
      }
    }
    cin >> a[n];
    if (a[n] != a[n - 1]) flag = 1;
    if (flag == 0) {
      cout << -1 << endl;
      continue;
    }
    if (flag2 == 0) {
      if (maxn > a[1] && maxn > a[n])
        cout << fuc << endl;
      else if (a[1] >= a[n])
        cout << 1 << endl;
      else if (a[1] < a[n])
        cout << n << endl;
      continue;
    }
    if ((maxn + (n - 3)) < a[1]) {
      if (a[1] < a[n])
        cout << n << endl;
      else
        cout << 1 << endl;
    } else if ((maxn + (n - 3)) < a[n]) {
      if (a[1] < a[n])
        cout << n << endl;
      else
        cout << 1 << endl;
    } else
      cout << fuc << endl;
  }
  return 0;
}
