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

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		for(int y=0;y<t;++y)
		{
		   int n=sc.nextInt();
		   int arr[]=new int[n];
		   boolean same=true;
		   for(int i=0;i<n;++i)
		   {
		       arr[i]=sc.nextInt();
		       if(i>0)
		       {
		           if(arr[i]!=arr[i-1])
		           same=false;
		       }
		       
		   }
		    int ans=0;
		       int greatest=arr[0];
		   if(same){
		   System.out.println(-1);
		   continue;
		   }
		  
		   else{
		       
		       for(int i=1;i<n;++i)
		       {
		          if(arr[i]>greatest){
		          ans=i;
		          greatest=arr[i];
		          }
		       }
		       if(ans!=0 && arr[ans-1]<greatest){
		       System.out.println(ans);continue;}
		       if(ans==0)
		       {
		           int i=0;
		           while(arr[i]==arr[i+1])
		           {
		               ++i;
		           }
		           System.out.println(i);
		           continue;
		       }
		   }
		   
		   
		}
	}
}
