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.*;
import java.lang.*;
import java.io.*;
public class UnderstandingGraph {
	public static void main (String[] args) throws java.lang.Exception
	{


	BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	int test=Integer.parseInt(br.readLine());
	while(test-->0){
	int n=Integer.parseInt(br.readLine().trim());
	String[] val=new String[n];
	val=br.readLine().trim().split("\\s");
	int out=-1;
int	max=0;
	for(int i=0;i<n-1;i++) {
		if(Integer.parseInt(val[i+1])>Integer.parseInt(val[i]) && Integer.parseInt(val[i+1])>max ) {
			out=i+2;
			max=Integer.parseInt(val[i+1]);
		}
		if(Integer.parseInt(val[i+1])<Integer.parseInt(val[i]) && Integer.parseInt(val[i])>max ) {
			out=i+1;
					max=Integer.parseInt(val[i]);
		}
	}
	System.out.println(out);
	}

	    
	    
	}
	}

