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 query;
  cin >> query;
  for (int q = 0; q < query; q++) {
    int N;
    cin >> N;
    int a[N];
    int maxVal = -1;
    int indexNorm = -1;
    for (int i = 0; i < N; i++) {
      cin >> a[i];
      if (a[i] > maxVal) {
        maxVal = a[i];
        indexNorm = i + 1;
      }
    }
    bool found = false;
    for (int i = 0; i < N; i++) {
      if (a[i] == maxVal && ((i - 1 >= 0 && a[i - 1] < maxVal) ||
                             (i + 1 < N && a[i + 1] < maxVal))) {
        indexNorm = i + 1;
        found = true;
        break;
      }
    }
    if (found == true)
      cout << indexNorm << endl;
    else
      cout << "-1" << endl;
  }
  return 0;
}
