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=[1,2,3,4]
for _ in range(int(input())):
    n=int(input())
    d=list(map(int,input().split()))
    cnt=0
    bl=1
    for i in range(n):
        cnt=0
        l=d[::]
        temp=i
        if(bl==0):
            break
        while(True):
            
            if(cnt==n-1):
                print(i+1)
                bl=0
                break
            if(temp==0):
                if(l[temp]>l[temp+1]):
                    l.pop(temp+1)
                    l[temp]+=1
                    cnt+=1
                else:
                    break
            elif(temp==n-1):
                if(l[temp]>l[temp-1]):
                    l.pop(temp-1)
                    temp-=1
                    l[temp]+=1
                    cnt+=1
                else:
                    break
            elif(l[temp]>l[temp-1]):
                l.pop(temp-1)
                cnt+=1
                temp-=1
                l[temp]+=1
            elif(l[temp]>l[temp+1]):
                l.pop(temp+1)
                l[temp]+=1
                cnt+=1
            else:
                break
                
    else:
        print(-1)