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 codeforces;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Dominant_Piranha {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int t = Integer.parseInt(br.readLine());
		
		while(t-- > 0)
		{
			int n = Integer.parseInt(br.readLine());
			String input[] = br.readLine().split(" ");
			long arr[] = new long[n];
			long max = 0;
			int index = -1;
			
			for(int i = 0;i<n;i++)
			{
				arr[i] = Long.parseLong(input[i]);
				
				if(arr[i] > max)
				{
					max = arr[i];
					index = i;
				}
			}
			int zero = index;
			while(zero > 0 && arr[zero] == arr[zero-1])
			{
				zero--;
			}
			int last = index;
			while(last < (n-1) && arr[last] == arr[last+1])
			{
				last++;
			}
			
			if(zero == 0)
			{
				if(last == (n-1))
				{
					System.out.println(-1);	
				}
				else 
				{
					System.out.println(last);
				}
				
			}
			else
			{
				System.out.println(zero);
			}
		}
	}

}
