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

test_count = int(input())

tests = []
for _ in range(test_count):
    x = int(input())
    y = list(map(int, input().split()))
    tests.append((x, y))

for test in tests:
    x, prns = test
    max_prn = max(prns)
    max_idx_list = []
    for idx, prn in enumerate(prns):
        if prn == max_prn:
            max_idx_list.append(idx)
    res = -1
    for idx in max_idx_list:
        if idx == 0:
            if 1 in max_idx_list:
                continue
            else:
                res = idx
                break
        elif idx == len(prns) - 1:
            if len(prns) - 2 in max_idx_list:
                continue
            else:
                res = idx
                break
        else:
            if idx - 1 in max_idx_list and idx + 1 in max_idx_list:
                continue
            else:
                res = idx
                break
    print(res)
