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 = list(map(int, input().split()))
    kek = []
    lol = max(ar)
    for i in range(n):
        if ar[i] == lol:
            kek.append(i)
    ans = -1
    for elem in kek:
        i = elem - 1
        j = i + 2
        flag = elem + 1
        num = lol
        while i >= 0 or j < n:
            if i >= 0 and ar[i] < num:
                num += 1
                i -= 1
            else:
                if j < n and ar[j] < num:
                    j += 1
                    num += 1
                else:
                    flag = -1
                    break
        if flag != -1:
            ans = flag
            break
    print(ans)
