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;
void PrintJam(int tc, int val) {
  cout << "Case #" << tc + 1 << ": " << val << '\n';
}
void PrintJam(int tc, const string& val) {
  cout << "Case #" << tc + 1 << ": " << val << '\n';
}
template <typename T>
void PrintJam(int tc, const vector<T>& val) {
  cout << "Case #" << tc + 1 << ": ";
  for (int i = 0; i < val.size(); ++i) {
    cout << val[i] << ' ';
  }
  cout << '\n';
}
template <typename T = int>
vector<T> ReadVector(int sz) {
  vector<T> v(sz);
  for (int i = 0; i < sz; ++i) cin >> v[i];
  return v;
}
template <typename Cont>
bool IsUnique(int sz, const Cont& a) {
  vector<bool> used(sz, false);
  for (auto el : a) {
    if (used[el]) return false;
    used[el] = true;
  }
  return true;
}
int64_t BinPow(int64_t a, int64_t p) {
  if (p == 0) return 1;
  if (p == 1) return a;
  if (p % 2 == 0) {
    auto r = BinPow(a, p / 2);
    return r * r;
  } else {
    auto r = BinPow(a, p - 1);
    return r * a;
  }
}
template <typename Predicate>
int bin(int from, int to, Predicate predicate) {
  while (from + 1 < to) {
    int m = from + (to - from) / 2;
    if (predicate(m))
      from = m + 1;
    else
      to = m;
  }
  return from;
}
vector<vector<int>> ReadGraph(int n, int m, bool orient = false,
                              bool minus_one = true) {
  vector<vector<int>> g(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    g[a - minus_one].push_back(b - minus_one);
    if (!orient) g[b - minus_one].push_back(a - minus_one);
  }
  return g;
}
using ll = int64_t;
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int t;
  cin >> t;
  for (int _ = 0; _ < t; ++_) {
    ll n;
    cin >> n;
    auto a = ReadVector(n);
    int start_max = -1, end_max = -1;
    bool bad = true;
    for (int i = 1; i < n; ++i) bad = bad && (a[i] == a[0]);
    if (bad) {
      cout << "-1\n";
      continue;
    }
    ll mval = -1;
    for (int i = 0; i < n; ++i) {
      if (a[i] > mval) {
        mval = a[i];
        start_max = end_max = i;
      } else if (a[i] == mval) {
        end_max = i;
      }
    }
    if (end_max == n - 1)
      cout << start_max + 1 << '\n';
    else
      cout << end_max + 1 << '\n';
  }
  return 0;
}
