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())
    a = list(map(int, input().split()))
    x = sorted(a, reverse=True)
    # print(x)
    ans = 0
    ind = -1
    for j in range(len(x)):
        ele = x[j]
        ind = a.index(ele, ind+1)
        # print(ind)
        if ind > 0 and ind < n-1:
            if a[ind-1] != ele or a[ind+1] != ele:
                ans = ind + 1
                # print("yo")
                break
        elif ind == 0:
            if a[ind+1] != ele:
                ans = ind + 1
                break
        elif ind == n-1:
            if a[ind-1] != ele:
                ans = ind + 1
                # print("yo")
                break
    if x[0] == x[n-1]:
        print('-1')
    else:
        print(ans)


