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.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Scanner;

public class Second {


    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int q = Integer.parseInt(in.readLine());
        while(q-->0) {
            int s = Integer.parseInt(in.readLine());
            String a [] = in.readLine().split(" ");
            int max = Integer.MIN_VALUE;
            int index = 0;
            boolean m = false;
            for (int i = 0; i < a.length - 1; i++) {
                if (Integer.parseInt(a[i]) != Integer.parseInt(a[ i + 1])){
                    m = true;
                }
            }
            if (m){
            for (int i = 0; i < a.length; i++) {
                int d = Integer.parseInt(a[i]);
                if (max < d){
                    max = d;
                    index = i;
                }
            }
            System.out.println(index);}
            else{
                System.out.println(-1);
            }


        }


    }


}