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 find_Dom(arr):
    m = min(arr)
    M = max(arr)
    if (m == M):
        return  -1
    # ar1 = arr[:arr.index(m)]
    # ar2 = arr[arr.index(m) + 1 :]
    # if ar2.index(M) != - 1:
    #     return ar2.index(M) + 2 + len(ar1)
    #
    # else:
    #     ar1.reverse()
    #     return len(ar1) - ar1.index(M) + 1
    # add = 1
    first = arr.index(M)
    if arr[0] != M:
        return first + 1
    #     else:
    #
    #         if arr[first + 1] != M:
    #             return  first + add
    #         else:
    #             arr.pop(first)
    #             add += 1
    for i in range(len(arr)):
        if arr[i] != M:
            return  i




r = int(input())
for _ in range(r):
    n = int(input())
    p = list(map(int,input().strip().split()))
    print(find_Dom(p))

