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 long long mod = 1e9 + 7;
void solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  int mx = 0, mi = INT32_MAX;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mx = max(v[i], mx);
    mi = min(v[i], mi);
  }
  if (mi == mx)
    cout << -1 << endl;
  else {
    int index = 0;
    for (int i = 0; i < n / 2; i++)
      if (v[i] == mx) index = i + 1;
    if (index == 0) {
      for (int i = n - 1; i >= n / 2; i--)
        if (v[i] == mx) index = i + 1;
    }
    cout << index << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int tt;
  cin >> tt;
  while (tt--) solve();
  return 0;
}
