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