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>
int dr[] = {2, 2, -2, -2, 1, -1, 1, -1};
int dc[] = {1, -1, 1, -1, 2, 2, -2, -2};
int dr1[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dc1[] = {1, -1, 1, 0, -1, 0, 1, -1};
int dr2[] = {0, 0, 1, -1};
int dc2[] = {1, -1, 0, 0};
using namespace std;
long long sum(long long x) { return (x * (x + 1)) / 2; }
long long dp[500005], a[500005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long i, j, c, x, len, tc, n, k;
  cin >> tc;
  while (tc--) {
    cin >> n;
    vector<pair<long long, long long> > v;
    for (i = 1; i <= n; i++) {
      long long x;
      cin >> x;
      a[i] = x;
      v.push_back({x, i});
    }
    sort(v.begin(), v.end());
    long long ans = -1;
    if (v[0].first == v.back().first)
      cout << "-1" << endl;
    else {
      for (i = 1; i <= n; i++) {
        if (a[i] == v.back().first) {
          if (i > 1 && a[i - 1] != v.back().first) ans = i;
          if (i < n && a[i + 1] != v.back().first) ans = i;
        }
      }
      cout << ans << endl;
    }
  }
  return 0;
}
