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;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n, ans;
    cin >> n;
    int arr[n];
    for (int j = 0; j < n; j++) cin >> arr[j];
    int pos = 0, av = 0;
    for (int j = 1; j < n; j++) {
      if (arr[j - 1] < arr[j]) {
        pos = j;
        av = 1;
      } else if (arr[j - 1] > arr[j]) {
        pos = j - 1;
        av = 1;
      } else
        pos = j;
    }
    if (av == 1)
      cout << pos + 1 << endl;
    else
      cout << "-1" << endl;
  }
  return 0;
}
