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 INF = 501;
const long long DIM = 3e5 + 1;
int in, n, t, a[DIM];
int main() {
  ios_base::sync_with_stdio;
  cin.tie(0);
  cout.tie(0);
  in = scanf("%d", &t);
  while (t--) {
    in = scanf("%d", &n);
    set<int> s;
    for (int i = 1; i <= n; i++) {
      in = scanf("%d", &a[i]);
      s.insert(a[i]);
    }
    if (s.size() == 1)
      printf("-1\n");
    else {
      auto it = s.end();
      it--;
      for (int i = 1; i <= n; i++) {
        if (a[i] == *it &&
            ((i > 1 && a[i - 1] != *it) || (i < n && a[i + 1] != *it))) {
          printf("%d\n", i);
          break;
        }
      }
    }
  }
  return 0;
}
