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

def f():
    n = int(input())
    a = list(map(int, input().split()))
    dom = max(a)
    ans = -1
    for j in range(1, n - 1):
        if a[j] == dom and (a[j - 1] != dom or a[j + 1] != dom):
            ans = j + 1
    if a[0] == dom and a[1] != dom:
        ans = 1
    elif a[n - 1] == dom and a[n - 2] != dom:
        ans = n
    print(ans)


t = int(input())
for i in range(t):
    f()