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, n, i, a[300005], k, big;
  cin >> t;
  while (t--) {
    cin >> n;
    cin >> a[1];
    k = 0;
    big = a[1];
    for (i = 2; i <= n; i++) {
      cin >> a[i];
      if (a[i] == a[i - 1]) k++;
      big = max(big, a[i]);
    }
    a[0] = big;
    a[n + 1] = big;
    if (k == n - 1)
      cout << -1 << endl;
    else {
      for (i = 1; i <= n; i++) {
        if (big == a[i] && ((a[i + 1] < big) || (a[i - 1] < big))) {
          cout << i << endl;
          break;
        }
      }
    }
  }
  return 0;
}
