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 tt in range(int(input())):
    n = int(input())
    a = list(map(int,input().split()))
    mx = max(a)
    found = 0
    for i in range(n):
        if a[i] == mx:
            cur = mx
            l,r = i-1,i+1
            while 0 <= l and a[l] < cur or r < n and cur > a[r]:
                if 0 <= l and a[l] < cur:
                    l -= 1
                    cur += 1
                if r < n and a[r] < cur:
                    r += 1
                    cur += 1
            if l == -1 and r == n:
                found = 1
                print(i+1)
                break
    if not found:
        print(-1)