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 sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0){
            int n=sc.nextInt();
            int[]a=new int[n];
            for(int i=0;i<n;i++){
                a[i]=sc.nextInt();
            }
            int c=0;
            Integer first = a[0];
            for (int i=1; i<a.length; i++) {
                if (a[i] == first) {
                    c++;
                }
            }
        int idx=-1;
            for(int i=0;i<n-1;i++){
                if(a[i]!=a[i+1])
                if(a[i]>a[i+1] || a[i]<a[i+1]){
                    if(a[i]>a[i+1]){
                       idx=i+1;
                    }
                    else{
                        idx=i+2;
                    }
                    break;
                }
            }
            if(c!=a.length-1)
            System.out.println(idx);
            else {
                System.out.println(-1);
            }
        }
    }
}
