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

#count gap
#start from left most 1, if meets 0, temp += 1, meets 1
#again, count += temp, until end
def print_result(ans):
    print(ans)

def solve(num_arr, n):
    MAX = max(num_arr)
    max_arr = [i for i in range(len(num_arr)) if num_arr[i] == MAX]
    if len(max_arr) == n:
        return -1
    elif max_arr[0] != 0:
        return max_arr[0] + 1
    elif max_arr[-1] != n-1:
        return max_arr[-1] + 1
    else:
        for i in range(len(max_arr)):
            if max_arr[i] != i:
                if max_arr[i] == n-1:
                    return n
                else:
                    return max_arr[i] + 1

    return -1
    
#main
t = int(input())
for i in range(1, t+1):
    n = int(input())
    num_arr = list(map(int, input().split()))

    ans = solve(num_arr, n)
    
    print_result(ans)