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;
bool f(int a[], int sum, int n) {
  int k = 0;
  for (int i = 0; i < n; i++) {
    k += a[i];
    if (k == sum) {
      k = 0;
    } else if (k > sum) {
      return 0;
    }
  }
  return (k == 0) ? 1 : 0;
}
void fun(int a[], int n) {
  int sum = 0;
  for (int i = 0; i < n; i++) sum += a[i];
  for (int i = 0; i < n; i++) {
    int x = n - i;
    if (sum % x == 0) {
      bool y = f(a, sum / x, n);
      if (y) {
        cout << i << "\n";
        return;
      }
    }
  }
  cout << "ahvjvjkb ";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    int k = 0;
    for (int i = 0; i < n - 1; i++) {
      if (a[i] != a[i + 1]) {
        k++;
        break;
      }
    }
    if (k == 0) {
      cout << "-1\n";
      continue;
    }
    vector<int> s(a, a + n);
    sort(s.begin(), s.end());
    k = s[n - 1];
    if (a[0] == k) {
      for (int i = 1; i < n; i++) {
        if (a[i] != a[i - 1]) {
          cout << i << "\n";
          break;
        }
      }
    } else {
      for (int i = 0; i < n; i++) {
        if (a[i] == k) {
          cout << i + 1 << "\n";
          break;
        }
      }
    }
  }
}
