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() {
  long T;
  scanf("%ld", &T);
  for (int t = 0; t < T; t++) {
    long n;
    scanf("%ld", &n);
    long arr[n];
    for (long i = 0; i < n; i++) scanf("%ld", &arr[i]);
    long min = *min_element(arr, arr + n), max = *max_element(arr, arr + n);
    if (min == max)
      printf("-1\n");
    else {
      if (arr[0] == max && arr[1] != max)
        printf("1\n");
      else if (arr[n - 1] == max && arr[n - 2] != max)
        printf("%ld\n", n);
      else {
        long i;
        for (i = 1; i < n - 1; i++) {
          if (arr[i] == max && (arr[i - 1] != max || arr[i + 1] != max)) break;
        }
        printf("%ld\n", i + 1);
      }
    }
  }
  return 0;
}
