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.io.*;

public class C{
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
	
	public static void main (String[] args) throws IOException{
        int t = Integer.parseInt(br.readLine());
        while(t-- > 0){
            int n = Integer.parseInt(br.readLine());
            String ip[] = br.readLine().split(" ");
            int ar[] = new int[n];
            int tot = 0;
            for(int i=0;i<n;i++){
                ar[i] = Integer.parseInt(ip[i]);
                if(ar[i]!=0){
                    tot++;
                }
            }
            if(tot==0){
                bw.write("-1\n");
                continue;
            }
            int max = 0;
            int idx = 0;
            for(int i=0;i<n;i++){
                if(ar[i]>max){
                    max = ar[i];
                    idx = i;
                }
            }
            if(tot==1){
                bw.write(idx + "\n");
                continue;
            }
            boolean can = true;
            for(int i=1;i<n-1;i++){
                if(ar[i]!=0 && ar[i+1]==0 && ar[i-1]==0){
                    can = false;
                }
            }
            if(n>2 && ar[0]!=0 && ar[1]==0){
                can = false;
            }
            if(n>2 && ar[n-1]!=0 && ar[n-2]==0){
                can = false;
            }
            if(!can){
                bw.write("-1\n");
                continue;
            }
            int cnt = 0;
            for(int i=1;i<n-1;i++){
                if(ar[i]==max && (ar[i+1]<max || ar[i-1]<max)){
                    idx = i;
                    cnt++;
                    break;
                }
            }
            if(n>1 && ar[0]==max && ar[1]<max){
                idx = 0;
                cnt++;
            }
            if(n>1 && ar[n-1]==max && ar[n-2]<max){
                idx = n-1;
                cnt++;
            }
            if(cnt==0){
                bw.write("-1\n");
            }else{
                bw.write(idx+1 + "\n");
            }
        }
        bw.flush();
    }
}