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;
long long ar[1000005];
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long mini = INT_MAX, maxi = INT_MIN;
    long long midx, maidx;
    for (long long i = 1; i <= n; i++) {
      cin >> ar[i];
      if (ar[i] <= mini) mini = ar[i], midx = i;
      if (ar[i] >= maxi) maxi = ar[i], maidx = i;
    }
    if (mini != maxi) {
      cout << maidx << "\n";
    } else
      cout << -1 << "\n";
  }
  return 0;
}
