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 Solution {
    public static void mainA(String[] args) {
        final Scanner in = new Scanner(System.in);

        final int T = in.nextInt();

        for (int t = 0; t < T; t += 1) {
            final int x = in.nextInt();

            int count = 0;
            search: for (int d = 1; d < 10; d += 1) {
                int p = 0;
                for (int n = 1; n < 5; n += 1) {
                    p = p * 10 + d;
                    count += n;
                    if (p == x) break search;
                }
            }

            System.out.println(count);
        }
    }


    public static void mainB(String[] args) {
        final Scanner in = new Scanner(System.in);

        final int T = in.nextInt();

        for (int t = 0; t < T; t += 1) {
            final int n = in.nextInt();
            final int[] a = new int[n];
            for (int i = 0; i < n; i += 1) a[i] = in.nextInt();

            boolean foundOne = false;
            int result = 0;
            int countZeroes = 0;
            for (int i = 0; i < n; i += 1) {
                foundOne = foundOne || a[i] == 1;
                if (!foundOne) continue;
                if (a[i] == 1) {
                    result += countZeroes;
                    countZeroes = 0;
                } else countZeroes += 1;
            }

            System.out.println(result);
        }
    }


    private static int gcd(int a, int b) {
        if (b == 0) return a;

        return gcd(b, a % b);
    }

    public static void mainC(String[] args) {
        final Scanner in = new Scanner(System.in);

        final int T = in.nextInt();

        for (int t = 0; t < T; t += 1) {
            final int n = in.nextInt();

            final int[] a = new int[n];
            for (int i = 0; i < n; i += 1) a[i] = in.nextInt();

            int max = 0;
            for (int i = 0; i < n; i += 1) if (a[i] > max) max = a[i];

            int result = -1;
            for (int i = 0; i < n; i += 1) {
                if (a[i] < max) continue;
                if (i > 0 && a[i - 1] < a[i]) {
                    result = i;
                    break;
                }
                if (i < n - 1 && a[i + 1] < a[i]) {
                    result = i;
                    break;
                }
            }

            System.out.println(result + 1);
        }
    }


    public static void mainD(String[] args) {
        final Scanner in = new Scanner(System.in);

        final int T = in.nextInt();

        for (int t = 0; t < T; t += 1) {
            final int n = in.nextInt();

            final int[] a = new int[n];
            for (int i = 0; i < n; i += 1) a[i] = in.nextInt();

        }
    }


    public static void mainE1(String[] args) {
        final Scanner in = new Scanner(System.in);

        final int T = in.nextInt();

        for (int t = 0; t < T; t += 1) {
            final int n = in.nextInt();

            final long s = in.nextLong();

            final int[][] edges = new int[n - 1][];

            for (int i = n - 2; i >= 0; i -= 1) {
                edges[i] = new int[] { in.nextInt(), in.nextInt(), in.nextInt() };
            }

            for (int i = 0; i < n - 1; i += 1) {
                System.out.println(Arrays.toString(edges[i]));
            }
        }

    }


    public static void mainF(String[] args) {
        final Scanner in = new Scanner(System.in);

        final int T = in.nextInt();

        for (int t = 0; t < T; t += 1) {
            final int n = in.nextInt();


            System.out.println(n);
//            System.out.println("=======");
        }
    }


    public static void main(String[] args) {
        mainC(args);
    }
}
