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

t=int(input())
for i in range(t):
    n=int(input())
    l1=input().split()
    l=[int(i1) for i1 in l1]
    m=max(l)
    ip=l.index(m)
    k=-1
    if (ip > 0):
        k=ip+1
    else:
        while ip!=(len(l)-1):
            if l[ip+1]==l[ip]:
                ip=ip+1
            elif l[ip+1]<l[ip]:
                k=ip+1
                break
    print(k)            