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;
const int maxn = 3e5 + 5;
int arr[maxn];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    vector<pair<int, int> > v;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &arr[i]);
      v.push_back({arr[i], i});
    }
    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());
    int ans = -1;
    for (int i = 0; i < n; i++) {
      if (v[i].second - 1 > 0) {
        if (arr[v[i].second - 1] < v[i].first) {
          ans = v[i].second;
          break;
        }
      }
      if (v[i].second + 1 <= n) {
        if (arr[v[i].second + 1] < v[i].first) {
          ans = v[i].second;
          break;
        }
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
