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;

//package kickStart_google;
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner; 
import java.util.StringTokenizer; 
public class Solution {


	
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		FastReader s=new FastReader(); 
		int t =  s.nextInt();
		StringBuilder st = new StringBuilder();
		for (int j = 0 ; j < t ; j++){
			int n = s.nextInt();
			int arr[] = new int[n];
			ArrayList<Integer> A = new ArrayList<>();
			int max = Integer.MIN_VALUE;
			for(int i = 0 ; i < n ; i++) {
				arr[i] = s.nextInt();
				if(arr[i] > max) {
					max = arr[i];
					A = new ArrayList<>();
					A.add(i);
				}else if(arr[i] == max) {
					A.add(i);
				}
			}
// 			System.out.println(A+"-------");
			if(A.size() == 1) {
				st.append(A.get(0)+"\n");
			}else {
				int ans = -1;
				for(int i = 1; i < A.size() ; i++) {
					if(A.get(i)-A.get(i-1) > 1) {
						ans = A.get(i);
						break;
					}
				}
				if(ans == -1) {
					if(A.get(0) != 0 ) ans = A.get(0);
					else if(A.get(A.size()-1) != n-1) ans = A.get(A.size()-1);
				}
				st.append(ans+"\n");
			}
			
		}
		System.out.println(st);
	}
	

	static 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; 
        } 
    }
}
//6
//13 82
//9 24
//20 30
//8 7
//53 4
//7 81