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

for _ in range(int(input())):
    n = int(input())
    a = list(map(int, input().split()))
    mx = max(a)
    if a.count(mx)==1:
        print(a.index(mx)+1)
    else:
        l = []
        for i in range(n-1):
            if a[i] == mx and a[i] == a[i+1]:
                l.append(i)
        if len(l)==0:
            print(a.index(mx)+1)
        elif len(l)==n-1:
            print(-1)
        else:
            l.insert(n-1, n-1)
            mx = 0
            s, e = 0, 0
            ind = -1
            # print(l)
            for i in range(len(l)):
                if i == 0:
                    if mx < l[i]+1:
                        mx = l[i]+1
                        s, e = 0, l[i]
                        # print(a[s:e+1])
                        ind = s+ a[s:e+1].index(max(a[s:e+1]))
                        # print(s, ind, "1st")
                else:
                    if mx < l[i]-l[i-1]+1:
                        mx = l[i]-l[i-1]+1
                        s, e = l[i-1]+1, l[i]
                        # print(a[s:e+1])
                        ind = s + a[s:e+1].index(max(a[s:e+1]))
                        # print(s, ind, "2nd")
            # print(mx, s, e)
            print(ind+1)