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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*; 

public class Solution {

   static ArrayList<ArrayList<Integer>> list;
	static int count=0;
	public static void main(String[] args)
    {
		FastReader fr=new FastReader();
       int t=fr.nextInt();
       while(t-->0) {
        
    	   int n=fr.nextInt();
    	   int a[]=new int[n];
    	   boolean allsame=true;
    	  for(int i=0;i<n;i++) {
    		  a[i]=fr.nextInt();
    		  if(i!=0&&a[i]!=a[i-1])
    			  allsame=false;
    	  }
    	  int pref[]=new int[n];
    	  int p=0;
    	  int s=0;
    	  int suf[]=new int[n];
    	  for(int i=0;i<n;i++) {
    		  pref[i]=p;
    		  p+=a[i];
    	  }
    	  for(int j=n-1;j>=0;j--) {
    		  suf[j]=s;
    		  s+=a[j];
    	  }
    	  
    	  boolean pos=false;
    	  int idx=0;
    	  for(int i=0;i<n;i++) {
    		  if(pref[i]>suf[i]) {
    			  if(i!=0&&a[i-1]<a[i]) {
    			  pos=true;
    			  idx=i;
    			  break;
    			  }
    		  }
    		  else if(pref[i]<suf[i]) {
    			  if(i!=n-1&&a[i+1]<a[i]) {
        			  pos=true;
        			  idx=i;
        			  break;
        			  }
    		  }
    		  
    	  }
    	  if(allsame==true)
    		  System.out.println(-1);
    	  else if(pos==true)
    		  System.out.println(idx+1);
    	  else 
    		  System.out.println(-1);
    	  
    
       }
    
    }
    	   
    	  
       
		
    public static boolean isPrime(int n) {
    	for(int i=2;i<=(int)(Math.sqrt(n));i++) {
    		if(n%i==0)
    			return false;
    	}
    	return true;
    }
	
	

}
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
 
    public FastReader()
    {
        br = new BufferedReader(new
                InputStreamReader(System.in));
    }
 
    String next()
    {
        while (st == null || !st.hasMoreElements())
        {
            try
            {
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }
 
    int nextInt()
    {
        return Integer.parseInt(next());
    }
 
    long nextLong()
    {
        return Long.parseLong(next());
    }
 
    double nextDouble()
    {
        return Double.parseDouble(next());
    }
 
    String nextLine()
    {
        String str = "";
        try
        {
            str = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}