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):
    j = int(input())
    lenn = 0
    n = list(map(int,input().split()))    
    for i in range(1, len(n) - 1):
        if n[i] < n[i + 1] or n[i] < n[i - 1]:
            lenn += 1
    if lenn == 0:
        print(-1)
    else:
        maxx = n[0]
        for i in range(1, len(n) - 1):
            if n[i] > n[i + 1] or n[i] > n[i - 1]:
                maxx = i
        if n[len(n) - 1] > maxx:
            maxx = len(n) - 1
        print(maxx)
        
