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 r in range(t):
    n=int(input())
    l=list(map(int,input().split()))
    w=[];c=0;d=0;u=0;v=0
    if len(set(l))==1:
        c=-1
    else:
        for i in range(n-1):
            if l[i+1]>l[i]:
                w=l[0:i+1]
                for j in range(len(w)):
                    if w[j]>=l[i+1]+j+1:
                        v=1
                        break
                w=l[i+2:]
                for j in range(len(w)):
                    if w[j]>=l[i+1]+j+1:
                        u=1
                        break
                if u!=1 and v!=1:
                    c=i+2
                    break
            elif l[i+1]<l[i]:
                u=0;v=0
                w=l[i+1:]
                for j in range(len(w)):
                    if w[j]>=l[i]+j+1:
                        u=1
                        break
                w=l[0:i]
                for j in range(len(w)):
                    if w[j]>=l[i]+j+1:
                        v=1
                        break
                if u!=1 and v!=1:
                    c=i+1
                    break
    if c==0:
        c=-1
    print(c)


