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

public class CDominantPrianha {
    public static void main(String[] args) {
        Scanner scnr = new Scanner(System.in);
        int n = Integer.parseInt(scnr.nextLine());

        while (n-- > 0) {
            int arrSize = Integer.parseInt(scnr.next());

            int[] input = new int[arrSize];

            for (int i = 0; i < arrSize; i++) {
                input[i] = scnr.nextInt();
            }

            System.out.print("[");
            for (int d : input) {
                System.out.print(d + " ");
            }
            System.out.println("]");

            piranha(input);
        }
        scnr.close();
    }

    static void piranha(int[] input) {
        PriorityQueue<Item> queue = new PriorityQueue<>((a, b) -> b.val - a.val);

        for (int i = 0; i < input.length; i++) {
            queue.add(new Item(input[i], i));
        }

        while (!queue.isEmpty()) {
            Item item = queue.remove();
            int left = item.index == 0 ? item.val + 1 : input[item.index - 1];
            int right = item.index == input.length - 1 ? item.val + 1 : input[item.index + 1];

            if (left < item.val || right < item.val) {
                System.out.println(item.index);
                return;
            }
        }
        System.out.println(-1);
    }
}

class Item {
    int val;
    int index;

    public Item(int val, int index) {
        this.val = val;
        this.index = index;
    }
}
