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;
const int maxn = 3e5 + 50;
const int inf = 0x7fffffff;
const int mod = 1e9 + 7;
const int HASH = 131;
int a[maxn];
int b[maxn];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      b[i] = a[i];
    }
    sort(a + 1, a + 1 + n);
    if (a[1] == a[n]) {
      cout << -1 << endl;
    } else {
      int ans = 0;
      for (int i = 1; i < n; i++) {
        if (b[i] == a[n]) {
          if (b[i] != b[i + 1]) {
            ans = i;
            break;
          }
        }
      }
      if (ans == 0) {
        for (int i = n - 1; i >= 1; i--) {
          if (b[i] != b[i + 1]) {
            ans = i + 1;
          }
        }
      }
      cout << ans << endl;
    }
  }
  return 0;
}
