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())
     a = list(map(int, input().split()))
     m = max(a)
     isEqual = 1
     maxIdx = None
     for i in range(1, n - 1):
          if a[i] != a[0]:
               isEqual = 0
          if a[i] == m and (a[i - 1] < m or a[i + 1] < m):
               maxIdx = i
     if not maxIdx:
          maxIdx = 0 if a[0] > a[-1] else n - 1
     if isEqual:
          isEqual = a[0] == a[-1]
     print(maxIdx + 1 if not isEqual else -1)
