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 typing


def rl(*args) -> typing.Iterable:
    """read input line and return iterable of split values"""
    func, funcs = int, (int, float, str)
    itr, itrs = iter, (iter, list, tuple, set)
    sep = " "
    for a in args:
        if a in funcs:
            func = a
        elif a in itrs:
            itr = a
        elif isinstance(a, str):
            sep = a
    return itr(map(func, input().strip().split(sep)))


T = int(input())

while T:
    T -= 1

    n = int(input())
    xs = rl(tuple)
    sxs = set(xs)

    if len(sxs) == 1:
        print(-1)
    else:
        max_x = max(sxs)
        last_weak = False
        last_max = False
        for i, x in enumerate(xs, 1):
            if x != max_x:
                if last_max:
                    print(i - 1)
                    break
                last_weak = True
                last_max = False
                continue
            else:
                if last_weak:
                    print(i)
                    break
                last_max = True
                last_weak = False
