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

import java.util.Scanner;

public class C {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int T = scan.nextInt();
        for(int t = 0; t<T; t++){
            int n= scan.nextInt();
            int max = 0;
            int maxPos = -1;
            int[] list = new int[n];
            for(int i = 0; i<n; i++){
                list[i] = scan.nextInt();
                if(list[i] > max){
                    max = list[i];
                }
            }
            int ans = -1;
            for(int i = 0; i<n-1; i++){
                if (list[i] == max && list[i+1]!=max) {
                    ans = i;
                }
            }

            for(int i = 1; i<n; i++){
                if (list[i] == max && list[i-1]!=max) {
                    ans = i;
                }
            }
            
            System.out.println(ans);


        }
    }
}