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

n1=int(input())
for x in range(n1):
    n2=int(input())
    arr=list(map(int,input().split(" ")))
    flag=True
    for y in range(1,len(arr)):
        if(arr[y-1]!=arr[y]):
            flag=False
    if(flag):
        print(-1)
    else:
        ind=max(arr)
        count=1
        flag1=False
        for y in range(0,len(arr)-1):
            if(arr[y]==ind and arr[y+1]!=ind):
                print(count)
                flag1=True
            else:
                count+=1
        if(not(flag1)):
            print(len(arr))
