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())
    ar = [int(i) for i in input().split()]
    if min(ar)==max(ar):
        print(-1)
    else:
        left = (n-1)//2
        right = left
        maxx = -1
        maxPtr = left
        while left>=0 and right<n:
            if ar[left] > maxx:
                maxx = ar[left]
                maxPtr = left
            if ar[right] > maxx:
                maxx = ar[right]
                maxPtr = right
            left-=1
            right+=1
        print(maxPtr+1)
        # k = max(ar)
        # b = []
        # for i in range(len(ar)):
        #     if ar[i] == k:
        #         b.append(i)
        # for i in range(len(b)-1):
        #     if b[i]+1!=b[i+1]:
        #         return i+1
        