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 other.cf7_div3;

import java.io.*;
import java.util.StringTokenizer;

public class AngryFish {
    public static void main(String[] args) throws IOException {
        final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int t = Integer.parseInt(st.nextToken());
        for (int i = 0; i < t; i++) {
            st = new StringTokenizer(br.readLine());
            int n = Integer.parseInt(st.nextToken());
            int[] arr = new int[n];
            st = new StringTokenizer(br.readLine());
            int max = -1;
            for (int j = 0; j < n; j++) {
                int cnt = Integer.parseInt(st.nextToken());
                if (max < cnt) {
                    max = cnt;
                }
                arr[j] = cnt;
            }
            boolean found = false;
            int rez = -1;
            for (int j = 1; j < n - 1; j++) {
                if (arr[j] == max && (arr[j - 1] < max || arr[j + 1] < max)) {
                    rez = j;
                    found = true;
                    break;
                }
            }
            if (!found && max > arr[1]) {
                rez = 0;
                found = true;
            }
            if (!found && max > arr[n - 2]) {
                rez = n - 1;
            }
            bw.write(rez + "\n");
        }
        bw.flush();
        bw.close();
    }
}
