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=list(map(int,input().split()))
    x=max(l1)
    y=l1.count(x)
    if y==1:
        print(l1.index(x)+1)
    else:
        l2=[]
        for i in range(n):
            if l1[i]==x:
                l2.append(i)
        if l2[0]>0:
            print(l2[0]+1)
        elif l2[y-1]!=n-1:
            print(l2[y-1]+1)
        else:
            f=0
            ans=0
            for i in range(len(l2)-1):
                if abs(l2[i]-l2[i+1])>1:
                    f=1
                    ans=l2[i]+1
                    break
            if f==1:
                print(ans)
            else:
                print(-1)
                