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(""))
    l = list(map(int,input("").split()))
    ll = list(reversed(l))
    a = max(l) 
    b = min(l)
    ai = l.index(a)
    aii = n-ll.index(a)-1
    ans = 0
    if a == b:
        ans = -1
    else :
        if ai != 0 :
          if l[ai-1] < a or l[ai +1] <a:
               ans = (ai+1)
        elif aii != n-1:
            if l[aii-1] < a or l[aii +1] <a:
               ans = (aii+1)
        else:
            for k in l:
                if k != a:
                    ans = l.index(k)
                    break
                
    print(ans)
            
               