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 a[300005], n, ans = -1;
inline void dfs(int u, int l, int r, int g) {
  if (r - l == n - 1) {
    ans = u;
    return;
  }
  if (l >= 1 && g > a[l]) dfs(u, l - 1, r, g + 1);
  if (r <= n && g > a[r]) dfs(u, l, r + 1, g + 1);
  return;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    int flag = 1, sym = 0, maxx = 0, maxflag = 1;
    for (int i = 1; i <= n; ++i) {
      scanf("%d", &a[i]);
      if (i == 1) {
        sym = a[i];
        maxx = a[i];
      } else {
        if (a[i] != sym) {
          flag = 0;
          if (a[i] > maxx) {
            maxflag = i;
            maxx = a[i];
          } else {
            if (a[i - 1] == maxx) {
              maxflag = i - 1;
              maxx = a[i - 1];
            }
          }
        }
      }
      if (a[i] > maxx) {
        maxflag = i;
        maxx = a[i];
      }
    }
    if (flag)
      cout << "-1" << endl;
    else
      cout << maxflag << endl;
  }
}
