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

t = int(input())
for h in range(t):
    f = int(input())
    n = list(map(int, input().split()))
    k = n[:]
    s = set(n)
    if len(s) == 1:
        print(-1)
    else:
        x = max(n)
        k.remove(x)
        if x in k:
            ans = n.index(x)
            if (ans !=0) or (n[ans+1] != x):
                print(ans+1)
            else:


                res = [idx for idx, val in enumerate(n) if val != x]
                print(res[0])
                # n = n[::-1]
                # ans = n.index(x)
                # if (ans !=0)  or (n[ans+1] != x):
                #     print(f-ans)
                # else:
                #     n = n[::-1]
                #     for i in range(f):
                #         if n[0] == n[1]:
                #             n.remove(x)
                #         else:
                #             print(i+1)
                #             break        
        else:
            ans = n.index(x)+1
            print(ans)

