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

import sys

num = int(sys.stdin.readline())
for i in range(num):
    t = int(sys.stdin.readline())
    lst = list(map(int, sys.stdin.readline().strip().split(' ')))
    all_equal = True
    last_num, idx = lst[0], 0
    freeze = False
    for j in range(1, len(lst)):
        if lst[j] != last_num:
            all_equal = False
        if lst[j] >= lst[idx]:
            if lst[j] == lst[idx] and freeze:
                continue
            idx = j
        else:
            freeze = True
        last_num = lst[j]
    print(-1 if all_equal else idx + 1)
