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())
while t:
    t-=1
    n=int(input())
    l=list(map(int,input().split()))
    m=float("inf")
    mi=-1
    M=0
    for i,v in enumerate(l):
        if v>M:
            M=v
        if v<m:
            m=v
            mi=i
    if M==m:
        print(-1)
        continue
    smaller=mi
    c=0
    while smaller>=0:
        if l[smaller]==M:
            Mi=smaller
            c=1
            break
        smaller-=1
    if c:
        print(Mi+1)
        continue
    bigger=mi

    while bigger<n:
        if l[bigger]==M:
            Mi=bigger
            break
        bigger+=1
    print(Mi+1)
