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

w = int(input())
for i in range(w):
  number = input()
  str = list(map(int, input().split()))
  max_elem = max(str)
  min_elem = min(str)
  max_ind = str.index(max_elem)
  ind = str.index(min_elem)
  if min_elem == max_elem:
    print(-1)
    continue
  for i in range(ind + 1, len(str)):
    if max_elem == str[i]:
      max_ind = i
      break
  for i in range(ind - 1, 0, -1):
    if max_elem == str[i]:
      max_ind = i
      break
  print(max_ind + 1)