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

a = int(input())
for k in range(a):
    b = int(input())
    c = [ int(i) for i in input().split()]
    m = max(c)
    if m == c[0]:
        for i in range(1,b):
            if c[i] != m:
                print(i)
                break
        else:
            print(-1)
    elif m == c[-1]:
        for i in range(b-1,-1,-1):
            if c[i] != m:
                print(i+2)
                break
    else:
        for i in range(b):
            if c[i] == m:
                print(i+1)
                break