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 _ in range(t):
    n = int(input())
    xs = list(map(int, input().split()))
    minx = min(xs)
    maxx = max(xs)
    if minx == maxx:
        print(-1)
    else:
        result = 0
        for ind in range(n - 1):
            x = xs[ind]
            y = xs[ind + 1]
            if x == maxx and x > y:
                result = ind
                break
            elif y == maxx and x < y:
                result = ind + 1
                break
        print(result + 1)

