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 tst;
  cin >> tst;
  while (tst--) {
    int n, arr[300008], ma = 0;
    vector<int> vec;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> arr[i];
      ma = max(ma, arr[i]);
    }
    for (int i = 1; i <= n; i++) {
      if (arr[i] == ma) vec.push_back(i);
    }
    if (vec.size() == 1)
      cout << vec[0] << endl;
    else if (vec.size() == n)
      cout << "-1" << endl;
    else {
      if (vec[0] == 1) {
        for (int i = 1; i <= n; i++) {
          if (arr[i] != ma) {
            cout << i - 1 << endl;
            break;
          }
        }
      } else
        cout << vec[0] << endl;
    }
  }
  return 0;
}
