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 math
# import sys
from collections import Counter, defaultdict, deque

def f(n, a):
    
    # lg = [(0, 0)]
    # for i in range(1, n):
    #     #print(i)
    #     if lg[i-1][0] <= a[i-1]:
    #         lg.append((a[i-1], i - 1))
    #     else:
    #         lg.append(lg[i - 1])
    # rg = [None for i in range(n)]
    # rg[-1] = (0, n-1)
    # for i in range(n-2, -1, -1):
    #     if rg[i+1][0] <= a[i+1]:
    #         rg[i] = (a[i+1], i + 1)
    #     else:
    #         rg[i] = rg[i + 1]

    # #print(lg, rg)

    # for i in range(1, n - 1):
    #     if a[i-1] < a[i] or a[i] > a[i+1]:
    #         #print("here", i)
    #         if lg[i][0] < a[i] + (i + lg[i][1] - 1) + (rg[i][1] - i - 1):
    #             return i + 1

    # if a[0] + rg[0][1] - 1 > rg[0][0]:
    #     return 1

    # if a[-1] + lg[-1][1] - 1 > lg[-1][0]:
    #     return n
    pv = max(a)
    #print(pv)
    for pos in range(1, n - 1):
        if a[pos] == pv and (a[pos] > a[pos - 1] or a[pos] > a[pos + 1]):
            #print(pos, "here")
            return pos + 1
        
    if a[0] == pv and a[1] < a[0]:
        return 1

    if a[-1] == pv and a[-2] < a[-1]:
        return n

    return -1

    


t = int(input())
result = []
for i in range(t):
    n = int(input())
    a = list(map(int, input().split()))
    result.append(f(n, a))
for i in range(t):
    print(result[i])
