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

def main():
    t = int(input())
    for i in range(t):
        n = int(input())
        a = list(map(int, input().split()))
        b = max(a)
        if min(a) == b:
            print(-1)
        else:
            ans = -1
            for k in range(n):
                if a[k] == b:
                    ans = k
                    break
            if ans == 0 and a[1] == b:
                for k in range(2, n):
                    if a[k] != b:
                        ans = k - 1
                        break
            print(ans + 1)
main()
