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 n, t;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<int> a(n);
    int mx = 0;
    for (auto &it : a) {
      cin >> it;
      mx = max(mx, it);
    }
    int r = n - 1;
    int ind = -1;
    for (int l = 0; l < n; l++) {
      if (a[l] != mx) continue;
      if (l > 0 && a[l - 1] != mx) ind = l + 1;
      if (r > l && a[l + 1] != mx) ind = l + 1;
    }
    cout << ind << endl;
  }
  return 0;
}
