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 Solution {
    
	public static void main (String[] args) throws java.lang.Exception {
	    
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    int t = Integer.parseInt(br.readLine());
	    while(t-- > 0) {
	        int n = Integer.parseInt(br.readLine());
	        String s[] = br.readLine().split(" ");
	        int nums[] = new int[n];
	        for (int i = 0; i < n; i++) {
	            nums[i] = Integer.parseInt(s[i]);
	        }
	        int ans = -1;
	        int firstIndex = 0;
	        int lastIndex = 0;
	        boolean noBreak = false;
	        for (int i = 0; i < n; i++) {
	            if (ans < nums[i]) {
	                ans = nums[i];
	                firstIndex = i+1;
	                lastIndex = i+1;
	                noBreak = true;
	            } else if (ans == nums[i] && noBreak) {
	                lastIndex = i+1;
	            } else {
	                noBreak = false;
	            }
	        }
	        if (firstIndex == 1 && lastIndex == n) {
	            System.out.println(-1);    
	        } else if (firstIndex == lastIndex) {
	            System.out.println(firstIndex);
	        } else if (firstIndex == 1) {
	            System.out.println(lastIndex);
	        } else {
	            System.out.println(firstIndex);
	        }
	        
	    }
	}
}
