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())
while t != 0:
    n = int(input())
    a = list(map(int, input().split()))[:n]
    if len(set(a)) == 1:
        print(-1)
        t -= 1
        continue
    i = 0
    j = n - 1
    z = max(a)
    while True:
        if a[i] == z and a[i + 1] < a[i]:
            ans = i + 1
            break
        if a[j] == z and a[j - 1] < a[j]:
            ans = j + 1
            break
        i += 1
        j -= 1
    print(ans)
    t -= 1
