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 MOD = 1e9 + 7;
int t, n;
int a[300101];
int maxx;
int main() {
  cin >> t;
  while (t--) {
    maxx = 0;
    bool flag = 0;
    cin >> n;
    int pos = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      maxx = max(maxx, a[i]);
    }
    for (int i = 1; i < n; i++)
      if (a[i] != a[i + 1]) flag = 1;
    if (flag == 0) {
      cout << -1 << "\n";
      continue;
    } else {
      a[n + 1] = a[n];
      a[0] = a[1];
      for (int i = n; i >= 1; i--) {
        if (a[i] == maxx && (a[i - 1] != a[i] || a[i] != a[i + 1])) {
          pos = i;
          break;
        }
      }
    }
    cout << pos << "\n";
  }
}
