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

def f(c, a):
    i = c
    while len(a)>1:
        if i < len(a) - 1 and a[i]>a[i+1]:
            a[i] += 1
            a.pop(i+1)
        elif i > 0 and a[i]>a[i-1]:
            a[i] += 1
            a.pop(i-1)
            i -= 1
        else: return 0
    return c+1
for _ in ' '*int(input()):
    n = int(input())
    a = list(map(int, input().split()))
    c = []
    m = max(a)
    for i, x in enumerate(a):
        if x == m: c.append(i)
    for c in c:
        x = f(c, a)
        if x > 0: print(x); break
    else: print(-1)