There are $n$ piranhas with sizes $a_1, a_2, \ldots, a_n$ in the aquarium. Piranhas are numbered from left to right in order they live in the aquarium.

Scientists of the Berland State University want to find if there is dominant piranha in the aquarium. The piranha is called dominant if it can eat all the other piranhas in the aquarium (except itself, of course). Other piranhas will do nothing while the dominant piranha will eat them.

Because the aquarium is pretty narrow and long, the piranha can eat only one of the adjacent piranhas during one move. Piranha can do as many moves as it needs (or as it can). More precisely:

The piranha $i$ can eat the piranha $i-1$ if the piranha $i-1$ exists and $a_{i - 1} < a_i$.

The piranha $i$ can eat the piranha $i+1$ if the piranha $i+1$ exists and $a_{i + 1} < a_i$.

When the piranha $i$ eats some piranha, its size increases by one ($a_i$ becomes $a_i + 1$).

Your task is to find any dominant piranha in the aquarium or determine if there are no such piranhas.

Note that you have to find any (exactly one) dominant piranha, you don't have to find all of them.

For example, if $a = [5, 3, 4, 4, 5]$, then the third piranha can be dominant. Consider the sequence of its moves:

The piranha eats the second piranha and $a$ becomes $[5, \underline{5}, 4, 5]$ (the underlined piranha is our candidate).

The piranha eats the third piranha and $a$ becomes $[5, \underline{6}, 5]$.

The piranha eats the first piranha and $a$ becomes $[\underline{7}, 5]$.

The piranha eats the second piranha and $a$ becomes $[\underline{8}]$.

You have to answer $t$ independent test cases.


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 2 \cdot 10^4$) — the number of test cases. Then $t$ test cases follow.

The first line of the test case contains one integer $n$ ($2 \le n \le 3 \cdot 10^5$) — the number of piranhas in the aquarium. The second line of the test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 10^9$), where $a_i$ is the size of the $i$-th piranha.

It is guaranteed that the sum of $n$ does not exceed $3 \cdot 10^5$ ($\sum n \le 3 \cdot 10^5$).


-----Output-----

For each test case, print the answer: -1 if there are no dominant piranhas in the aquarium or index of any dominant piranha otherwise. If there are several answers, you can print any.


-----Examples-----

Input
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
Output
3
-1
4
3
3
1


-----Note-----

The first test case of the example is described in the problem statement.

In the second test case of the example, there are no dominant piranhas in the aquarium.

In the third test case of the example, the fourth piranha can firstly eat the piranha to the left and the aquarium becomes $[4, 4, 5, 4]$, then it can eat any other piranha in the aquarium.

Source: codeforces | Difficulty: EASY
Tags: Greedy algorithms

Constructive algorithms


Solutions:
from sys import stdin, stdout
ans = []

def main():
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	maxval = max(arr)
	ind = -2
	for i in range(n):
		if arr[i] == maxval:
			if i > 0 and arr[i - 1] != maxval:
				ind = i
				break
			if i < n - 1 and arr[i + 1] != maxval:
				ind = i
				break
	ans.append(str(ind + 1))
for i in range(int(stdin.readline())):
	main()
stdout.write('\n'.join(ans))


from sys import stdin
input = stdin.readline
from itertools import groupby, accumulate

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	for (i, v) in enumerate(a):
		if v == m and (i > 0 and v > a[i - 1] or (i < n - 1 and v > a[i + 1])):
			print(i + 1)
			return
	print(-1)
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for z in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	ans = -1
	max_ = max(l)
	check = False
	for i in range(n):
		if l[i] == max_:
			if n > i + 1 >= 0 and l[i + 1] != max_ or (n > i - 1 >= 0 and l[i - 1] != max_):
				check = True
				ans = i + 1
				break
	print(ans)


for i in range(int(input())):
	input()
	s = list(map(int, input().split()))
	i = j = s.index(max(s)) + 1
	if j == 1:
		j = -1
		while i < len(s):
			if s[i - 1] != s[i]:
				j = i
				break
			i += 1
	print(j)


t = int(input())
for i in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	if len(set(b)) == 1:
		print(-1)
	else:
		m = max(b)
		j = 0
		while j < n:
			if j < n - 1 and b[j] == m and (b[j + 1] != m):
				print(j + 1)
				break
			if j > 0 and b[j] == m and (b[j - 1] != m):
				print(j + 1)
				break
			j += 1


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	mi = min(l)
	if m == mi:
		print(-1)
	else:
		a = l.index(m)
		for i in range(n):
			if l[i] != m and l[i + 1] == m:
				print(i + 2)
				break
			elif l[i] == m and l[i + 1] != m:
				print(i + 1)
				break


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = sorted(a)
	if b[0] == b[-1]:
		print(-1)
	else:
		m = max(a)
		for i in range(len(a)):
			if a[i] == m and (i > 0 and a[i - 1] < m or (i < n - 1 and a[i + 1] < m)):
				print(i + 1)
				break


from collections import deque
from math import ceil, sqrt
import sys
for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	mx = max(a)
	ans = -1
	for i in range(0, n - 1):
		if a[i] > a[i + 1] and a[i] == mx:
			ans = i + 1
	for i in range(1, n):
		if a[i] > a[i - 1] and a[i] == mx:
			ans = i + 1
	print(ans)


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	c = a.count(m)
	if c == n:
		ans = -1
	else:
		for i in range(n):
			if a[i] == m:
				if i - 1 >= 0 and a[i - 1] < m or (i + 1 < n and a[i + 1] < m):
					ans = i + 1
					break
	print(ans)


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	p = [int(i) for i in input().split()]
	mm = p[0]
	idx = 0
	same = True
	for i in range(1, n):
		if p[i] > mm:
			mm = p[i]
			same = False
			idx = i
		elif p[i] < mm:
			same = False
	if same:
		print(-1)
	else:
		found = False
		for i in range(1, n):
			if p[i] != mm and p[i - 1] == mm:
				print(i)
				found = True
				break
		if found:
			continue
		for i in range(0, n - 1):
			if p[i] != mm and p[i + 1] == mm:
				print(i + 2)
				break


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	set_ = set(l)
	x = len(set_)
	if x == 1:
		print(-1)
	else:
		start = 0
		max_ = max(l)
		idx = l.index(max_)
		r = False
		for i in range(idx + 1, n):
			if l[i] == max_:
				start = i
			if l[i] < max_:
				r = True
				break
		if r and start != 0:
			print(start + 1)
		else:
			print(idx + 1)


from itertools import permutations
from collections import defaultdict
from math import *
import os
import sys
from io import BytesIO, IOBase
from heapq import nlargest
from bisect import *
import copy
import itertools
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
t = int(input())
while t:
	t -= 1
	n = int(input())
	arr = list(map(int, input().split()))
	val = max(arr)
	if len(set(arr)) == 1:
		print('-1')
	else:
		for i in range(n):
			if arr[i] == val:
				if i != 0:
					if arr[i] > arr[i - 1]:
						ans = i + 1
						break
				if i != n - 1:
					if arr[i] > arr[i + 1]:
						ans = i + 1
						break
		print(ans)


def dominant(a):
	max_value = max(a)
	for i in a:
		if i != max_value:
			if a[0] == max_value and a[1] != max_value:
				return 1
			for j in range(1, len(a)):
				if a[j] == max_value and (a[j - 1] != max_value or a[j + 1] != max_value):
					return j + 1
	return -1
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	print(dominant(a))


for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	if len(set(lst)) == 1:
		print(-1)
	else:
		mx = lst[0]
		indx = 1
		for i in range(1, n - 1):
			y = lst[i]
			if y >= mx:
				mx = y
				if lst[i + 1] < mx or lst[i - 1] < mx:
					indx = i + 1
		if mx < lst[n - 1]:
			indx = n
		print(indx)


import sys
input = sys.stdin.buffer.readline

def solution():
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	for i in range(n):
		if l[i] == m:
			if i - 1 >= 0 and l[i - 1] < l[i]:
				print(i + 1)
				return
			if i + 1 < n and l[i + 1] < l[i]:
				print(i + 1)
				return
	print(-1)
t = int(input())
for _ in range(t):
	solution()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	flag = -1
	for i in range(n):
		if a[i] == m:
			if i == 0:
				if a[i + 1] < m:
					print(i + 1)
					flag = 1
					break
			elif i == n - 1:
				if a[i - 1] < m:
					print(i + 1)
					flag = 1
					break
			elif a[i + 1] < m or a[i - 1] < m:
				print(i + 1)
				flag = 1
				break
	if flag == -1:
		print(-1)


for _ in range(int(input())):
	l = int(input())
	x = list(map(int, input().split()))
	var = max(x)
	var1 = min(x)
	x.append(var)
	x.insert(0, var)
	if var == var1:
		print(-1)
	else:
		for a in range(len(x) - 2):
			if x[a + 1] == var:
				if x[a + 2] != var or x[a] != var:
					print(a + 1)
					break
					break


for test in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	maxValue = max(a)
	ans = -1
	for i in range(n):
		if a[i] == maxValue and i + 1 < n and (a[i] > a[i + 1]):
			ans = i
		if a[i] == maxValue and i - 1 >= 0 and (a[i - 1] < a[i]):
			ans = i
	print(-1 if ans == -1 else ans + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	n = max(a)
	k = 0
	for i in range(len(a)):
		if a[i] == n:
			if i == 0:
				if a[i + 1] < n:
					k += 1
					break
			elif i == len(a) - 1:
				if a[i - 1] < n:
					k += 1
					break
			elif a[i + 1] < n or a[i - 1] < n:
				k += 1
				break
	if k != 0:
		print(i + 1)
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	m = max(a)
	if a.count(m) == n:
		print(-1)
		continue
	ans = []
	for i in range(n):
		if a[i] == m:
			ans.append(i)
	x = 0
	for i in ans:
		if i + 1 < n and a[i] > a[i + 1] or (i - 1 >= 0 and a[i] > a[i - 1]):
			x = i + 1
			break
	print(x)


def solve(n, arr):
	maxx = max(arr)
	for i in range(len(arr)):
		if arr[i] == maxx:
			if i == 0:
				if arr[i + 1] < arr[i]:
					return i + 1
			elif i == len(arr) - 1:
				if arr[i - 1] < arr[i]:
					return i + 1
			elif arr[i - 1] < arr[i] or arr[i + 1] < arr[i]:
				return i + 1
	return -1
for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print(solve(n, arr))


import math
from collections import Counter
try:
	for _ in range(int(input())):
		n = int(input())
		arr = [int(i) for i in input().split()]
		flg = 0
		mx = max(arr)
		for idx in range(n):
			if arr[idx] == mx:
				if idx != 0 and idx != n - 1:
					a = arr[idx - 1]
					b = arr[idx + 1]
					if a < mx or b < mx:
						ans = idx + 1
						flg += 1
						break
				elif idx == 0:
					if arr[idx + 1] < mx:
						ans = idx + 1
						flg += 1
						break
				elif arr[idx - 1] < mx:
					ans = idx + 1
					flg += 1
					break
		if flg:
			print(ans)
		else:
			print(-1)
except EOFError as e:
	print(e)


t = int(input())
while t:
	n = int(input())
	s = list(map(int, input().split()))
	if len(s) == 1:
		print(1)
		t -= 1
		continue
	all_same = True
	curr = s[0]
	for i in range(len(s)):
		if s[i] != curr:
			all_same = False
	if all_same:
		print(-1)
		t -= 1
		continue
	max_val = 0
	for i in range(len(s)):
		max_val = max(max_val, s[i])
	if s[0] == max_val:
		if len(s) > 1:
			if s[1] < max_val:
				print(1)
				t -= 1
				continue
	if s[-1] == max_val:
		if len(s) > 1:
			if s[-2] < max_val:
				print(len(s))
				t -= 1
				continue
	for i in range(1, len(s) - 1):
		if s[i] == max_val:
			if s[i - 1] < max_val or s[i + 1] < max_val:
				print(i + 1)
				break
	t -= 1


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print(-1)
	else:
		mx = max(arr)
		ans = 1
		for x in range(n):
			if arr[x] == mx:
				(a, b) = (False, False)
				if x - 1 >= 0 and arr[x - 1] < mx:
					a = True
				if x + 1 < n and arr[x + 1] < mx:
					b = True
				if a or b:
					ans = x + 1
					break
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	m = max(a)
	mc = a.count(m)
	if mc == n:
		print(-1)
	elif mc == 1:
		print(a.index(m) + 1)
	else:
		ans = 0
		for i in range(n):
			if a[i] == m and i + 1 != n and (a[i + 1] < m):
				ans = i + 1
				break
			elif a[i] == m and i != 0 and (a[i - 1] < m):
				ans = i + 1
			else:
				pass
		print(ans)


T = int(input())
for t in range(T):
	n = int(input())
	A = [int(i) for i in input().split()]
	mx = max(A)
	idxs = []
	for i in range(n):
		if A[i] == mx:
			idxs.append(i)
	ans = -1
	for index in idxs:
		if index - 1 >= 0:
			if A[index] > A[index - 1]:
				ans = index
				break
		if index + 1 < n:
			if A[index] > A[index + 1]:
				ans = index
				break
	if ans != -1:
		print(ans + 1)
	else:
		print(-1)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ma = max(a)
	mi = min(a)
	if ma == mi:
		print(-1)
	elif a[0] == ma and a[0] > a[1]:
		print(1)
	elif a[-1] == ma and a[-1] > a[-2]:
		print(n)
	else:
		for x in range(1, n - 1):
			if a[x] == ma and (a[x - 1] < ma or a[x + 1] < ma):
				print(x + 1)
				break


t = int(input())
for i in range(t):
	n = int(input())
	S = list(map(int, input().split()))
	max_fish = 0
	max_pos = -1
	for j in range(0, n):
		if max_fish < S[j] and (j > 0 and S[j] > S[j - 1] or (j < n - 1 and S[j] > S[j + 1])):
			max_fish = S[j]
			max_pos = j + 1
	print(max_pos)


t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	if min(A) == max(A):
		print(-1)
	else:
		M = max(A)
		for (i, a) in enumerate(A):
			if M == a:
				if i != 0 and i != n - 1:
					if A[i - 1] != M or A[i + 1] != M:
						print(i + 1)
						break
				elif i == 0:
					if A[i + 1] != M:
						print(i + 1)
						break
				elif A[i - 1] != M:
					print(i + 1)
					break


for t in range(int(input())):
	n = int(input())
	a = [int(j) for j in input().split()]
	if max(a) == min(a):
		print(-1)
	else:
		M = max(a)
		i = a.index(M)
		if i == 0:
			while i < n - 1 and M == a[i + 1]:
				i += 1
		print(i + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	(m1, m2) = (max(a), min(a))
	if m1 == m2:
		print(-1)
	else:
		x = 1
		for i in range(n):
			if i == 0:
				if a[i] == m1 and a[i + 1] != m1:
					x = i + 1
					break
			elif i == n - 1:
				if a[i] == m1 and a[i - 1] != m1:
					x = n
					break
			elif a[i] == m1 and (a[i - 1] != m1 or a[i + 1] != m1):
				x = i + 1
				break
		print(x)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split(' ')))
	if max(arr) == min(arr):
		print(-1)
	else:
		largest = max(arr)
		smallest = min(arr)
		i = 0
		while i < n:
			if arr[i] == largest and i == 0 and (arr[i] > arr[i + 1]):
				print(i + 1)
				break
			elif arr[i] == largest and i == n - 1 and (arr[i] > arr[i - 1]):
				print(i + 1)
				break
			elif i != 0 and i != n - 1 and (arr[i] == largest) and (arr[i] > arr[i - 1] or arr[i] > arr[i + 1]):
				print(i + 1)
				break
			i += 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()


def find(A, x):
	for i in range(len(A)):
		if x == A[i] and i != len(A) - 1 and (A[i] > A[i + 1]):
			return i + 1
		elif x == A[i] and i != 0 and (A[i] > A[i - 1]):
			return i + 1
	return -1
t = int(input())
for i in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	x = max(A)
	print(find(A, x))


n = int(input())
for j in range(n):
	x = int(input())
	y = list(map(int, input().split()))
	g = max(y)
	checked = True
	if x == 1:
		print(1)
		continue
	if y[0] > y[1] and y[0] == g:
		print(1)
		checked = False
	for i in range(1, x - 1):
		if y[i] == g and (y[i + 1] != y[i] or y[i - 1] != y[i]) and checked:
			checked = False
			print(i + 1)
			break
	if (y[x - 1] > y[x - 2] and y[x - 1] == g) and checked:
		print(x)
		checked = False
	if checked:
		print(-1)


import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math
import random
import re
import heapq
t = int(input())
while t:
	t -= 1
	n = int(input())
	arr = list(map(int, input().split()))
	s = set(arr)
	if len(s) == 1:
		print(-1)
		continue
	m = 0
	for i in range(1, len(arr) - 1):
		if arr[i] >= arr[m] and (arr[i - 1] < arr[i] or arr[i + 1] < arr[i]):
			m = i
	if arr[n - 1] >= arr[m] and arr[n - 2] < arr[n - 1]:
		m = n - 1
	print(m + 1)


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	dominant = max(a)
	if len(set(a)) == 1:
		print(-1)
	else:
		ans = 0
		for i in range(n - 1):
			if a[i] == dominant and a[i + 1] != dominant:
				ans = i
		if ans == 0:
			for i in range(1, n):
				if a[i] == dominant and a[i - 1] != dominant:
					ans = i
		print(ans + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	s = list(map(int, input().split()))
	m = -1
	v = -1
	for i in range(n):
		if s[i] > v and (s[i] > s[max(0, i - 1)] or s[i] > s[min(n - 1, i + 1)]):
			m = i
			v = s[i]
	if m == -1:
		print(-1)
	else:
		print(m + 1)


import array
T = int(input())
for Tid in range(T):
	n = int(input())
	a = array.array('i', map(int, input().split()))
	(f1, f2) = (0, -1)
	for i in range(n):
		if a[i] > a[f1]:
			f1 = i
	for i in range(n):
		if a[i] == a[f1]:
			if i != 0 and a[i - 1] < a[i]:
				f2 = i + 1
			if i != n - 1 and a[i + 1] < a[i]:
				f2 = i + 1
	print(f2)


test_num = int(input())
while test_num:
	test_num -= 1
	length = int(input())
	fish = [int(n) for n in input().split()]
	(a, b) = (max(fish), min(fish))
	if a == b:
		print(-1)
		continue
	site = fish.index(a)
	if site:
		print(site + 1)
	else:
		while site < length - 1:
			if fish[site] != fish[site + 1]:
				print(site + 1)
				break
			else:
				site += 1


for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	if len(set(ar)) == 1:
		print(-1)
	else:
		maxi = max(ar)
		flag = 0
		for i in range(n - 1):
			if ar[i] == maxi and ar[i + 1] != maxi:
				ind = i
				flag = 1
				break
		if flag != 1:
			for i in range(1, n):
				if ar[i] == maxi and ar[i - 1] != maxi:
					ind = i
					flag = 1
					break
		print(ind + 1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	ll = l.copy()
	ll.sort()
	ma = 0
	ans = 0
	if ll[0] == ll[len(l) - 1]:
		print(-1)
	else:
		ma = max(l)
		if l.index(ma) != 0:
			print(l.index(ma) + 1)
		else:
			for i in range(n):
				if l[i] != ma:
					ans = i
					break
			if not ans:
				print(n)
			else:
				print(ans)


t = int(input())
for _ in range(0, t):
	n = int(input())
	aa = [int(i) for i in input().split()]
	ss = -1
	mx = max(aa)
	for i in range(0, n):
		if aa[i] == mx:
			if i + 1 < n and aa[i] > aa[i + 1]:
				ss = i + 1
				break
			if i - 1 >= 0 and aa[i] > aa[i - 1]:
				ss = i + 1
				break
	print(ss)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	_max = a[0]
	SAMEF = True
	ans = -1
	for i in range(n):
		if a[i] >= _max:
			_max = a[i]
			SAMEF = False
			if i > 0 and i < n - 1:
				if a[i - 1] < a[i] or a[i + 1] < a[i]:
					ans = i + 1
			elif i > 0:
				if a[i - 1] < a[i]:
					ans = i + 1
			elif i < n - 1:
				if a[i + 1] < a[i]:
					ans = i + 1
	if SAMEF:
		print(ans)
	else:
		print(ans)


def ans(a, n):
	if max(a) == min(a):
		return -1
	t = [a[i] for i in range(n)]
	for i in range(n - 1):
		if t[i] > t[i + 1]:
			t[i] += 1
	for i in range(n - 1, 0, -1):
		if t[i] > t[i - 1]:
			t[i] += 1
	ind = -1
	maxm = -1
	for i in range(len(t)):
		if t[i] > maxm:
			maxm = t[i]
			ind = i + 1
	return ind
m = int(input())
for j in range(m):
	n = int(input())
	arr = input().split()
	a = []
	for i in arr:
		a.append(int(i))
	print(ans(a, n))


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	maxi = max(l)
	start = l[0]
	f = 0
	for i in range(1, n):
		if l[i] != start:
			f = 1
			break
	if f == 0:
		print(-1)
	else:
		ans = -1
		for i in range(n):
			if l[i] == maxi:
				if i + 1 < n and l[i + 1] != maxi:
					ans = i
					break
				if i - 1 >= 0 and l[i - 1] != maxi:
					ans = i
					break
		print(ans + 1)


t = int(input())
for tc in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	ans = [i for i in range(n) if a[i] == mx and (i != 0 and a[i - 1] < mx or (i != n - 1 and a[i + 1] < mx))]
	print('-1' if len(ans) == 0 else ans[0] + 1)


import sys, math, collections, itertools
from collections import defaultdict
from functools import reduce

def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w')

def get_array():
	l = list(map(int, input().split()))
	return l

def get_ints():
	return map(int, input().split())

def sod(n):
	(n, c) = (str(n), 0)
	for i in n:
		c += int(i)
	return c

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def getFloor(A, x):
	(left, right) = (0, len(A) - 1)
	floor = -1
	while left <= right:
		mid = (left + right) // 2
		if A[mid] == x:
			return A[mid]
		elif x < A[mid]:
			right = mid - 1
		else:
			floor = A[mid]
			left = mid + 1
	return floor

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def chk_power_of_2(n):
	return n & n - 1 == 0

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def main():
	for tt in range(int(input())):
		n = int(input())
		l = get_array()
		if len(list(set(l))) == 1:
			print(-1)
		else:
			m = max(l)
			ans = l.index(m)
			if ans == 0:
				for i in range(n):
					if l[i] != m:
						ans = i - 1
						break
			print(ans + 1)
main()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
	else:
		x = l[:]
		x.sort(reverse=True)
		for i in range(len(x)):
			f = 0
			for j in range(len(l)):
				if x[i] == l[j]:
					if j == 0:
						if l[j + 1] < l[j]:
							f = 1
							break
					elif j == n - 1:
						if l[j - 1] < l[j]:
							f = 1
							break
					elif l[j - 1] < l[j] or l[j + 1] < l[j]:
						f = 1
						break
			if f == 1:
				print(j + 1)
				break


for _ in ' ' * int(input()):
	a = int(input())
	b = list(map(int, input().split()))
	if len(set(b)) == 1:
		print(-1)
	else:
		k = max(b)
		p = 0
		for i in range(a):
			if i == 0:
				if b[i] == k and b[i + 1] != k:
					p = i + 1
					break
			elif i == a - 1:
				if b[i] == k and b[i - 1] != k:
					p = i + 1
					break
			elif b[i] == k and (b[i - 1] != k or k != b[i + 1]):
				p = i + 1
				break
		print(p)


for i1 in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	c = l.copy()
	c.sort()
	if c[0] == c[-1]:
		print(-1)
	else:
		ans = l.index(max(l)) + 1
		ans2 = max(l)
		if ans != 1:
			print(ans)
		else:
			check = ans - 1
			for i in range(check, len(l)):
				if l[i] != ans2:
					t1 = i
					break
			print(t1)


T = int(input())
for _ in range(T):
	N = int(input())
	piranhas = [int(p) for p in input().split(' ')]
	largest_index = None
	for i in range(len(piranhas)):
		if largest_index == None or piranhas[i] > piranhas[largest_index]:
			if i > 0 and piranhas[i - 1] < piranhas[i] or (i < N - 1 and piranhas[i + 1] < piranhas[i]):
				largest_index = i
				largest_size = piranhas[i]
	print(largest_index + 1 if largest_index != None else -1)


import sys
for _ in range(int(input())):
	a = int(input())
	b = list(map(int, input().split()))
	if a == 1:
		print(1)
		sys.exit()
	c = max(b)
	ans = -1
	for i in range(a):
		if b[i] == c:
			f = False
			if i < a - 1 and b[i] > b[i + 1]:
				f = True
			else:
				f = False
			if i > 0 and b[i] > b[i - 1]:
				f = True
			elif not f:
				f = False
			if f:
				ans = i + 1
				break
	print(ans)


for i in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	m = max(s)
	f = 0
	r = 0
	x = 0
	if s[0] == m and s[1] < m:
		print(1)
	elif s[len(s) - 1] == m and s[len(s) - 2] != m:
		print(len(s))
	else:
		for j in range(1, len(s) - 1):
			if s[j] == m and (s[j - 1] != m or s[j + 1] != m):
				print(j + 1)
				break
		else:
			print(-1)


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().rstrip().split())
inl = lambda : list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))
t = ini()
for _ in range(t):
	n = ini()
	a = inl()
	if len(set(a)) == 1:
		print(-1)
	else:
		ans = 0
		for i in range(1, n - 1):
			if a[i] > a[i + 1] or a[i] > a[i - 1]:
				if a[i] > ans:
					ans_i = i + 1
				ans = max(ans, a[i])
		if a[0] > ans:
			ans = a[0]
			ans_i = 1
		if a[-1] > ans:
			ans_i = n
		print(ans_i)


import sys
from collections import defaultdict
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	lis = list(map(int, input().split()))
	if len(set(lis)) == 1:
		print(-1)
		continue
	m = max(lis)
	for i in range(n):
		if lis[i] == m:
			if i >= 1 and lis[i - 1] < lis[i] or (i < n - 1 and lis[i + 1] < lis[i]):
				print(i + 1)
				break


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().strip().split(' ')))
	if len(list(set(a))) == 1:
		print(-1)
	else:
		kk = max(a)
		for j in range(n):
			if j != 0 and j != n - 1:
				if a[j] == kk:
					if a[j - 1] < a[j] or a[j + 1] < a[j]:
						print(j + 1)
						break
			elif j == 0:
				if a[j] == kk:
					if a[j + 1] < a[j]:
						print(j + 1)
						break
			elif j == n - 1:
				if a[j] == kk:
					if a[j - 1] < a[j]:
						print(j + 1)
						break


for _ in range(int(input())):
	n = int(input())
	ara = list(map(int, input().strip().split()))
	maxx = max(ara)
	if ara.count(maxx) == n:
		print(-1)
	elif ara.count(maxx) == 1:
		for i in range(n):
			if ara[i] == maxx:
				print(i + 1)
	elif ara[0] == maxx and ara[1] != maxx:
		print(1)
	else:
		for i in range(1, n - 1):
			if ara[i] == maxx and (ara[i + 1] != maxx or ara[i - 1] != maxx):
				print(i + 1)
				break


t = int(input())
for _ in range(0, t):
	n = int(input())
	a = [int(i) for i in input().split()]
	ans = -1
	mx = max(a)
	for i in range(0, n):
		if a[i] == mx:
			if i + 1 < n and a[i] > a[i + 1]:
				ans = i + 1
				break
			if i - 1 >= 0 and a[i] > a[i - 1]:
				ans = i + 1
				break
	print(ans)


for _ in range(int(input())):
	x = input()
	l = list(map(int, input().split()))
	if len(l) == 1:
		print(1)
	elif len(set(l)) == 1:
		print(-1)
	else:
		m = 0
		a = -1
		for j in range(len(l)):
			m = max(m, l[j])
			if m == l[j]:
				if j - 1 >= 0 and l[j - 1] < m:
					a = j + 1
				if j + 1 < len(l) and l[j + 1] < m:
					a = j + 1
		print(a)


def Dominant_Piranha(arr):
	n = len(arr)
	Max = max(arr)
	if arr[n - 1] == Max and arr[n - 2] < Max:
		return n
	for i in range(n - 2, -1, -1):
		if arr[i] == Max:
			if arr[i - 1] < Max or arr[i + 1] < Max:
				return i + 1
	else:
		return -1
t = int(input())
final = []
for i in range(t):
	n = int(input())
	arr = list((int(x) for x in input().split()))
	res = Dominant_Piranha(arr)
	final.append(res)
for i in final:
	print(i)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	maxx = max(a)
	minn = min(a)
	if maxx == minn:
		print(-1)
	else:
		for i in range(n):
			if a[i] == maxx and i == 0:
				if a[i + 1] < a[i]:
					print(i + 1)
					break
				else:
					continue
			if a[i] == maxx and i == n - 1:
				if a[i - 1] != a[i]:
					print(i + 1)
					break
				else:
					continue
			if a[i] == maxx and (a[i - 1] < maxx or a[i + 1] < maxx):
				print(i + 1)
				break


t = int(input())
for iii in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	s = a[:]
	x = max(s)
	if max(a) == min(a):
		print(-1)
	else:
		for i in range(len(a)):
			if a[i] == x:
				if i == 0:
					if a[i] > a[i + 1]:
						print(i + 1)
						break
				elif i == len(a) - 1:
					if a[i] > a[i - 1]:
						print(i + 1)
						break
				elif a[i] > a[i + 1] or a[i] > a[i - 1]:
					print(i + 1)
					break


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
from collections import defaultdict
sys.setrecursionlimit(300000)

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24

def solve():
	n = N()
	ar = lis()
	if ar.count(ar[0]) == n:
		print(-1)
		return
	m = max(ar)
	ans = -1
	for i in range(1, n - 1):
		if ar[i] == m and (ar[i] > ar[i - 1] or ar[i] > ar[i + 1]):
			ans = i
			print(ans + 1)
			return
	if ans == -1:
		if ar[0] == m:
			ans = 0
		elif ar[n - 1] == m:
			ans = n - 1
	print(ans + 1)
testcase(int(inp()))


for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print(-1)
	else:
		d = max(arr)
		for j in range(1, n):
			if arr[j] == d and arr[j - 1] != d:
				print(j + 1)
				break
			elif arr[j] != d and arr[j - 1] == d:
				print(j)
				break


t = int(input())
for j in range(t):
	n = int(input())
	a = input().split()
	for i in range(len(a)):
		a[i] = int(a[i])
	maximum = max(a)
	flag = 0
	n = len(a)
	if a[0] == maximum:
		if a[1] < maximum:
			flag = 1
			print(1)
	elif a[n - 1] == maximum:
		if a[n - 2] < maximum:
			flag = 1
			print(n)
	if flag == 0:
		for i in range(1, n - 1):
			if a[i] == maximum:
				if a[i + 1] < maximum or a[i - 1] < maximum:
					flag = 1
					print(i + 1)
					break
	if flag == 0:
		print('-1')


def farr(s):
	all_freq = {}
	for i in s:
		if i in all_freq:
			all_freq[i] += 1
		else:
			all_freq[i] = 1
	return all_freq

def nextInt():
	return int(input())

def intArr():
	arr = input().split(' ')
	return [int(x) for x in arr]
t = nextInt()
ans = []
for tt in range(t):
	n = nextInt()
	arr = intArr()
	if len(farr(arr)) == 1:
		ans.append(-1)
	elif len(arr) == 2:
		if arr[0] > arr[1]:
			ans.append(1)
		else:
			ans.append(2)
	else:
		m = max(arr)
		for x in range(len(arr)):
			if x == 0 and arr[x] == m and (arr[x] > arr[x + 1]):
				ans.append(x + 1)
				break
			elif x != 0 and x != len(arr) - 1 and (arr[x] == m) and (x != len(arr) - 1) and (arr[x] > arr[x + 1] or arr[x] > arr[x - 1]):
				ans.append(x + 1)
				break
			elif x == len(arr) - 1 and arr[x] == m and (arr[x] > arr[x - 1]):
				ans.append(x + 1)
				break
for x in ans:
	print(x)


for i in range(int(input())):
	n = int(input())
	l = input().split()
	l = [int(e) for e in l]
	nl = sorted(l)
	if nl[0] == nl[-1]:
		print(-1)
	else:
		m = max(l)
		for i in range(len(l)):
			if l[i] == m:
				if i == 0:
					if l[i] > l[i + 1]:
						print(i + 1)
						break
				elif i == len(l) - 1:
					if l[i] > l[i - 1]:
						print(i + 1)
						break
				elif l[i] > l[i + 1] or l[i] > l[i - 1]:
					print(i + 1)
					break


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(val) for val in input().split(' ')]
	m = max(arr)
	res = -1
	for i in range(n):
		if arr[i] == m and (i > 0 and arr[i - 1] < m or (i < n - 1 and arr[i + 1] < m)):
			res = i + 1
			break
	print(res)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
		continue
	ans = 0
	m = 0
	if l[0] > l[1]:
		m = l[0]
		ans = 0
	for i in range(1, n - 1):
		if l[i] >= m and (l[i - 1] < l[i] or l[i + 1] < l[i]):
			m = l[i]
			ans = i
	if l[n - 1] > l[n - 2] and l[n - 1] > m:
		m = l[n - 1]
		ans = n - 1
	print(ans + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	f = max(a)
	if a.count(f) == n:
		print(-1)
		continue
	if len(a) == 1 or len(a) == 2:
		print(a.index(max(a)) + 1)
		continue
	r = 0
	for i in range(len(a)):
		if i == 0:
			if a[i] == f:
				if a[i + 1] < f:
					print(i + 1)
					r = 1
					break
		elif i == n - 1:
			if a[i] == f:
				if a[i - 1] < f:
					print(i + 1)
					r = 1
					break
		elif a[i] == f:
			if a[i - 1] < f or a[i + 1] < f:
				print(i + 1)
				r = 1
				break
	if r != 1:
		print(a.index(f))


for _ in range(int(input())):
	n = int(input())
	l = [int(x) for x in input().split(' ')]
	if len(set(l)) == 1:
		print(-1)
		continue
	l = [0] + l + [0]
	mx = max(l)
	for i in range(1, len(l) - 1):
		if l[i] == mx and (l[i - 1] < l[i] and l[i - 1] != 0 or (l[i + 1] < l[i] and l[i + 1] != 0)):
			print(i)
			break


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	ind = -1
	for i in range(len(a)):
		if a[i] == m and (i > 0 and a[i] > a[i - 1] or (i < n - 1 and a[i] > a[i + 1])):
			ind = i + 1
	print(ind)


import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
mod = 10 ** 9 + 7

def lcm(x, y):
	return x * y / gcd(x, y)

def fact(x, mod=mod):
	ans = 1
	for i in range(1, x + 1):
		ans = ans * i % mod
	return ans

def arr2D(n, m, default=0):
	return [[default for j in range(m)] for i in range(n)]

def arr3D(n, m, r, default=0):
	return [[[default for k in range(r)] for j in range(m)] for i in range(n)]

def sortDictV(x):
	return {k: v for (k, v) in sorted(x.items(), key=lambda item: item[1])}

class DSU:

	def __init__(self, length):
		self.length = length
		self.parent = [-1] * self.length

	def getParent(self, node, start):
		if node >= self.length:
			return False
		if self.parent[node] < 0:
			if start != node:
				self.parent[start] = node
			return node
		return self.getParent(self.parent[node], start)

	def union(self, node1, node2):
		parent1 = self.getParent(node1, node1)
		parent2 = self.getParent(node2, node2)
		if parent1 == parent2:
			return False
		elif self.parent[parent1] <= self.parent[parent2]:
			self.parent[parent1] += self.parent[parent2]
			self.parent[parent2] = parent1
		else:
			self.parent[parent2] += self.parent[parent1]
			self.parent[parent1] = parent2
		return True

	def getCount(self, node):
		return -self.parent[self.getParent(node, node)]

def solve(n, lst):
	maxx = max(lst)
	yes = False
	for i in range(n):
		if i == 0:
			if lst[0] == maxx and lst[1] != maxx:
				return 1
		elif i == n - 1:
			if lst[i] == maxx and lst[i - 1] != maxx:
				return i + 1
		elif lst[i] == maxx and (lst[i] > lst[i - 1] or lst[i] > lst[i + 1]):
			return i + 1
	return -1
for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	print(solve(n, lst))


import sys
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, sys.stdin.readline().split()))
	p = max(a)
	if len(set(a)) == 1:
		print(-1)
	else:
		j = 1
		an = -1
		while j < n - 1:
			if a[j] == p:
				if a[j - 1] != p or a[j + 1] != p:
					an = j + 1
					break
			j = j + 1
		if an == -1:
			if a[0] == p and a[1] != p:
				an = 1
			elif a[-1] == p and a[-2] != p:
				an = n
		print(an)


for _ in range(int(input())):
	n = int(input())
	c = -1
	m = -1
	a = [int(x) for x in input().split()]
	if a[0] > a[1]:
		c = 1
		m = a[0]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] or a[i] > a[i + 1]:
			if a[i] > m:
				c = i + 1
				m = a[i]
	if a[n - 1] > a[n - 2]:
		if a[n - 1] > m:
			c = n - 1 + 1
	print(c)


for ct in range(int(input())):
	n = int(input())
	v = [int(i) for i in input().split()]
	ma = max(v)
	for i in range(n):
		if v[i] == ma:
			if i > 0 and v[i - 1] < ma or (i < n - 1 and v[i + 1] < ma):
				print(i + 1)
				break
	else:
		print(-1)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	arr = list(map(int, sys.stdin.readline().split()))
	maxp = max(arr)
	length = len(arr)
	for i in range(length):
		if maxp == arr[i]:
			if i == 0 and maxp > arr[i + 1]:
				print(i + 1)
				break
			elif i == length - 1 and maxp > arr[i - 1]:
				print(i + 1)
				break
			elif i != 0 and i != length - 1 and (arr[i - 1] < maxp or arr[i + 1] < maxp):
				print(i + 1)
				break
		if i == length - 1:
			print(-1)


t = int(input())

def check(a):
	if a.count(a[0]) == len(a):
		return False
	else:
		return True
for q in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	ans = a.index(m) + 1
	if a[0] == m and a[1] != m:
		ans = 1
	elif a[-1] == m and a[n - 2] != m:
		ans = n
	else:
		for i in range(1, n - 1):
			if a[i] == m and (a[i - 1] != m or a[i + 1] != m):
				ans = i + 1
				break
	if not check(a):
		print(-1)
	else:
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	x = sorted(a, reverse=True)
	ans = 0
	ind = -1
	for j in range(len(x)):
		ele = x[j]
		ind = a.index(ele, ind + 1)
		if ind > 0 and ind < n - 1:
			if a[ind - 1] != ele or a[ind + 1] != ele:
				ans = ind + 1
				break
		elif ind == 0:
			if a[ind + 1] != ele:
				ans = ind + 1
				break
		elif ind == n - 1:
			if a[ind - 1] != ele:
				ans = ind + 1
				break
	if x[0] == x[n - 1]:
		print('-1')
	else:
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
	else:
		z = max(a)
		ans = -1
		for i in range(n):
			if i - 1 >= 0 and a[i] > a[i - 1] and (a[i] == z):
				ans = i + 1
				break
			if i != n - 1 and a[i] > a[i + 1] and (a[i] == z):
				ans = i + 1
				break
		print(ans)


import sys
t = int(sys.stdin.readline())
ans_arr = []
for i in range(t):
	n = int(sys.stdin.readline())
	a = [int(j) for j in sys.stdin.readline().split()]
	equal = True
	for g in range(n):
		if a[g] != a[0]:
			equal = False
			break
	if equal:
		ans_arr.append('-1')
	else:
		mx = max(a)
		ans = 1
		for p in range(n):
			if a[p] == mx:
				if p - 1 >= 0 and mx > a[p - 1]:
					ans = p + 1
					break
				if p + 1 < n and mx > a[p + 1]:
					ans = p + 1
					break
		ans_arr.append(str(ans))
print('\n'.join(ans_arr))


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	if len(set(a)) == 1:
		print(-1)
		continue
	mx = max(a)
	p = 0
	for i in range(n):
		if i == 0 and a[i] == mx:
			if a[i] > a[i + 1]:
				p = i
				break
		elif i == n - 1 and a[i] == mx:
			if a[i] > a[i - 1]:
				p = i
				break
		elif a[i] == mx:
			if a[i] > a[i + 1] or a[i] > a[i - 1]:
				p = i
				break
	print(p + 1)


def find_Dom(arr):
	m = min(arr)
	M = max(arr)
	if m == M:
		return -1
	first = arr.index(M)
	if arr[0] != M:
		return first + 1
	for i in range(len(arr)):
		if arr[i] != M:
			return i
r = int(input())
for _ in range(r):
	n = int(input())
	p = list(map(int, input().strip().split()))
	print(find_Dom(p))


import re

def count(arr):
	allmatch = re.findall('0+', arr)
	if arr[0] == '0':
		allmatch.pop(0)
	if allmatch and arr[len(arr) - 1] == '0':
		allmatch.pop()
	ans = 0
	for i in range(len(allmatch)):
		ans += len(allmatch[i])
	return ans
for i in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	mx = max(a)
	flag = True
	for j in a:
		if mx != j:
			flag = False
			break
	ans = -1
	if not (flag or n == 1):
		for j in range(n):
			if a[j] == mx and j == 0 and (a[j + 1] != mx):
				ans = j + 1
				break
			if a[j] == mx and j == n - 1 and (a[j - 1] != mx):
				ans = j + 1
				break
			if a[j] == mx and j != 0 and (j != n - 1) and (a[j - 1] != mx or a[j + 1] != mx):
				ans = j + 1
				break
	print(ans)


l = int(input())
while l:
	p = input()
	n = list(map(int, input().split()))
	(m, p) = (-1, 0)
	if len(set(n)) == 1:
		print('-1')
		p = 1
	else:
		for i in range(len(n)):
			if m <= n[i]:
				m = n[i]
				if i != 0 and i != len(n) - 1:
					if n[i] > n[i - 1] or n[i] > n[i + 1]:
						f = i + 1
				elif i == 0:
					if n[i] > n[i + 1]:
						f = i + 1
				elif n[i] > n[i - 1]:
					f = i + 1
	if p == 0:
		print(f)
	l -= 1


def solver(arr, n):
	amax = max(arr)
	i = 0
	while i < n:
		if arr[i] == amax:
			if i - 1 != -1 and arr[i - 1] != amax:
				break
			if i + 1 != n and arr[i + 1] != amax:
				break
		if i == n - 1:
			return -1
		i += 1
	return i + 1
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(solver(arr, n))


for _ in range(int(input())):
	n = int(input())
	pir = list(map(int, input().split()))
	biggest = max(pir)
	ans = -1
	for i in range(n):
		if pir[i] == biggest and (pir[i] > pir[max(i - 1, 0)] or pir[i] > pir[min(i + 1, n - 1)]):
			ans = i
	if ans != -1:
		print(ans + 1)
	else:
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	for j in range(n):
		if l[j] == m:
			b1 = False
			b2 = False
			if j >= 1:
				if l[j - 1] != m:
					b1 = True
			if j < n - 1:
				if l[j + 1] != m:
					b2 = True
			if b1 or b2:
				print(j + 1)
				break
	else:
		print(-1)


import math
from collections import Counter, defaultdict, deque

def f(n, a):
	pv = max(a)
	for pos in range(1, n - 1):
		if a[pos] == pv and (a[pos] > a[pos - 1] or a[pos] > a[pos + 1]):
			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])


(z, zz) = (input, lambda : list(map(int, z().split())))
fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = 1
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = 1
num = int(z())
for _ in range(num):
	n = int(z())
	arr = zzz()
	if len(set(arr)) == 1:
		print(-1)
		continue
	t = max(arr)
	c = 0
	for i in range(1, n - 1):
		if arr[i] == t and arr[i + 1] != t or (arr[i] == t and arr[i - 1] != t):
			c = 1
			print(i + 1)
			break
	if c == 0:
		print(arr.index(t) + 1)


t = int(input())
for i in range(t):
	n = int(input())
	lst = []
	flag = 0
	lst = [int(x) for x in input().split()]
	a = max(lst)
	if lst[0] == a and lst[1] < a:
		print(1)
		flag = 1
	elif lst[n - 1] == a and lst[n - 2] < a:
		print(n)
		flag = 1
	else:
		for i in range(1, n - 1):
			if lst[i] == a and (lst[i - 1] < a or lst[i + 1] < a):
				print(i + 1)
				flag = 1
				break
	if flag == 0:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
	else:
		m = max(a)
		p = a.index(m) + 1
		for i in range(1, n - 1):
			if a[i] == m:
				if a[i - 1] != a[i] or a[i] != a[i + 1]:
					p = i + 1
					break
		print(p)


def f(c, a):
	i = c
	while len(a) > 1:
		if i < len(a) - 1 and a[i] > a[i + 1]:
			a[i] += 1
			a.pop(i + 1)
		elif i > 0 and a[i] > a[i - 1]:
			a[i] += 1
			a.pop(i - 1)
			i -= 1
		else:
			return 0
	return c + 1
for _ in ' ' * int(input()):
	n = int(input())
	a = list(map(int, input().split()))
	c = []
	m = max(a)
	for (i, x) in enumerate(a):
		if x == m:
			c.append(i)
	for c in c:
		x = f(c, a)
		if x > 0:
			print(x)
			break
	else:
		print(-1)


t = int(input())
for tn in range(1, t + 1):
	n = int(input())
	a = list(map(int, input().split()))
	dom = max(a)
	di = -1
	for i in range(1, n - 1):
		if a[i] == dom:
			if a[i - 1] < dom or a[i + 1] < dom:
				di = i + 1
				break
	if di == -1:
		if a[0] == dom and a[1] < dom:
			di = 1
		elif a[-1] == dom and a[-2] < dom:
			di = n
	print(di)


for i in range(int(input())):
	n = int(input())
	size = list(map(int, input().split()))
	dicti = {size[i]: i for i in range(n)}
	if len(dicti) == 1:
		print(-1)
	else:
		max_i = max(size)
		for i in range(len(size)):
			if size[i] == max_i:
				if i == 0 and size[i + 1] != max_i:
					print(i + 1)
					break
				elif i == len(size) - 1 and size[i - 1] != max_i:
					print(i + 1)
					break
				elif i != 0 and i != len(size) - 1 and (size[i - 1] != max_i or size[i + 1] != max_i):
					print(i + 1)
					break


t = int(input())
for i in range(t):
	n = int(input())
	values = list(map(int, input().split(' ')))
	val = 0
	res = -2
	for j in range(n):
		jl = max(0, j - 1)
		jr = min(n - 1, j + 1)
		v = values[j]
		vl = values[jl]
		vr = values[jr]
		if v > val and (v > vl or v > vr):
			val = v
			res = j
	print(res + 1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
	else:
		mx = max(l)
		for i in range(n):
			if l[i] == mx:
				if i < n - 1 and l[i] > l[i + 1] or (i > 0 and l[i] > l[i - 1]):
					print(i + 1)
					break


tests = int(input())
for _ in range(tests):
	n = int(input())
	arr = list(map(int, input().strip().split()))
	if arr.count(arr[0]) == n:
		print(-1)
	else:
		flag = False
		maxvalue = max(arr)
		if arr[0] == maxvalue:
			if arr[1] < maxvalue:
				print(1)
				flag = True
		elif arr[n - 1] == maxvalue:
			if arr[n - 2] < maxvalue:
				print(n)
				flag = True
		if not flag:
			for i in range(1, n - 1):
				if arr[i] == maxvalue:
					if arr[i - 1] < maxvalue or arr[i + 1] < maxvalue:
						print(i + 1)
						break


import sys
INP = lambda : sys.stdin.readline().strip()
INT = lambda : int(INP())
MAP = lambda : map(int, INP().split())
ARR = lambda : [int(i) for i in INP().split()]

def JOIN(arr, x=' '):
	return x.join([str(i) for i in arr])

def EXIT(x='NO'):
	print(x)
	exit()
for _ in range(INT()):
	(n, arr) = (INT(), ARR())
	m = max(arr)
	i = arr.index(m)
	if i > 0 or (i == 0 and arr[1] != m):
		print(i + 1)
		continue
	ans = -1
	for i in range(1, n):
		if arr[i] == m:
			if arr[i - 1] != m:
				ans = i + 1
				break
			elif i < n - 1:
				if arr[i + 1] != m:
					ans = i + 1
					break
	print(ans)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	if y == 0:
		return 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	n = scanner()
	a = get_list()
	m = max(a)
	if len(set(a)) == 1:
		print(-1)
	for i in range(n):
		if a[i] == m and i < n - 1 and (a[i + 1] < m):
			print(i + 1)
			return
		elif a[i] == m and i > 0 and (a[i - 1] < m):
			print(i + 1)
			return
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = scanner()
for i in range(t):
	solve()


t = int(input())
while t > 0:
	n = int(input())
	nums = list(map(int, input().split()))
	maxVal = nums[0]
	cnt = 0
	for i in range(n):
		if nums[i] == nums[0]:
			cnt += 1
		if maxVal < nums[i]:
			maxVal = nums[i]
	if cnt == n:
		print(-1)
	else:
		for i in range(n):
			if nums[i] != maxVal:
				continue
			if i > 0 and nums[i - 1] < maxVal:
				print(i + 1)
				break
			if i < n - 1 and nums[i + 1] < maxVal:
				print(i + 1)
				break
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = max(a)
	for i in range(n):
		if a[i] == b:
			j = i
			break
	y = -2
	for i in range(j, n):
		if i == 0:
			if a[i] > a[i + 1]:
				y = i
				break
		elif i == n - 1:
			if a[i] > a[i - 1]:
				y = i
				break
		elif a[i] > a[i - 1] or a[i] > a[i + 1]:
			y = i
			break
	print(y + 1)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	c = a.count(a[0])
	if c != n:
		res = []
		if a[0] > a[1]:
			res.append(a[0] + 1)
		else:
			res.append(a[0])
		mx = [res[0], 1]
		for i in range(1, n - 1):
			x = a[i]
			if x > min(a[i + 1], a[i - 1]):
				x += 1
			if x > max(a[i + 1], a[i - 1]):
				x += 1
			res.append(x)
			if x > mx[0]:
				mx[0] = x
				mx[1] = i + 1
		if a[n - 1] > a[n - 2]:
			res.append(a[n - 1] + 1)
			if res[n - 1] > mx[0]:
				mx = [res[n - 1], n]
		print(mx[1])
	else:
		print(-1)


t = int(input())
for i in range(t):
	s = input()
	s = input()
	s1 = s.split()
	l = [int(i) for i in s1]
	flag = 0
	start = l[0]
	for i in range(len(l)):
		if l[i] != start:
			flag = 1
			break
	if flag == 0:
		print(-1)
	else:
		maxval = max(l)
		for i in range(len(l)):
			if l[i] == maxval:
				if i > 0 and l[i] > l[i - 1]:
					print(i + 1)
					break
				if i < len(l) - 1 and l[i] > l[i + 1]:
					print(i + 1)
					break


t = int(input())
for i in range(t):
	ans = 0
	n = int(input())
	a = list(map(int, input().split()))
	res = True
	res = all((ele == a[0] for ele in a))
	if res:
		print('-1')
	else:
		x = max(a)
		for j in range(len(a)):
			if a[j] == x:
				if j - 1 >= 0 and a[j - 1] < a[j]:
					ans = j + 1
				if j + 1 < n and a[j + 1] < a[j]:
					ans = j + 1
		print(ans)


for _ in range(int(input())):
	N = int(input())
	arr = list(map(int, input().split()))
	mx = max(arr)
	res = -1
	for i in range(N):
		if arr[i] != mx:
			continue
		if i > 0 and arr[i - 1] != mx:
			res = i + 1
		if i < N - 1 and arr[i + 1] != mx:
			res = i + 1
	print(res)


import sys
import math

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
t = II()
for q in range(t):
	n = II()
	a = LI()
	if len(set(a)) == 1:
		print(-1)
	else:
		m = max(a)
		for i in range(n):
			boo = False
			if a[i] == m:
				if i - 1 > -1 and a[i - 1] < a[i] or (i + 1 < n and a[i + 1] < a[i]):
					boo = True
			if boo == True:
				ans = i + 1
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	ele = max(arr)
	pos = -1
	for i in range(n):
		if arr[i] == ele:
			if i == 0:
				if arr[i + 1] < ele:
					pos = i + 1
					break
			elif i == n - 1:
				if arr[i - 1] < ele:
					pos = i + 1
					break
			elif arr[i + 1] < ele or arr[i - 1] < ele:
				pos = i + 1
				break
	print(pos)


tmp = int(input())
for _ in range(tmp):
	nVar = int(input())
	arr = [int(someVar) for someVar in input().split()]
	if arr.count(arr[0]) == nVar:
		print(-1)
	else:
		indexVal = -1
		maxVal = max(arr)
		for ite in range(nVar):
			if arr[ite] == maxVal:
				if ite > 0:
					if arr[ite - 1] < maxVal:
						indexVal = ite
				if ite < nVar - 1:
					if arr[ite + 1] < maxVal:
						indexVal = ite
		if indexVal == -1:
			print(-1)
		else:
			print(indexVal + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	max_ = max(arr)
	min_ = min(arr)
	if max_ == min_:
		print(-1)
	else:
		idx = -1
		for i in range(0, n):
			if arr[i] == max_:
				if i > 0 and arr[i - 1] < max_:
					idx = i + 1
				if i < n - 1 and arr[i + 1] < max_:
					idx = i + 1
		print(idx)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
		continue
	maximum = max(a)
	answer = 1
	if a[0] == maximum and a[0] != a[1]:
		answer = 1
	for i in range(1, n - 1):
		if a[i] == maximum and (a[i] != a[i + 1] or a[i - 1] != a[i]):
			answer = i + 1
			break
	if a[n - 1] == maximum and a[n - 2] != a[n - 1]:
		answer = n
	print(answer)


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


def checkSides(index, arr, size):
	left = True if index - 1 >= 0 and arr[index - 1] < arr[index] else False
	right = True if index + 1 < size and arr[index + 1] < arr[index] else False
	return left or right
tests = int(input())
for t in range(tests):
	size = int(input())
	A = list(map(int, input().split()))
	found = False
	maxx = max(A)
	for i in range(size):
		if A[i] == maxx:
			if checkSides(i, A, size):
				print(i + 1)
				found = True
				break
	if not found:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	b = True
	for i in range(len(a)):
		if a[i] != m:
			b = False
			break
	if b:
		print(-1)
	else:
		for i in range(len(a)):
			if a[i] == m:
				if i == 0:
					if a[i + 1] < m:
						print(i + 1)
						break
				elif i == n:
					if a[i - 1] < m:
						print(i + 1)
						break
				elif a[i - 1] < m or a[i + 1] < m:
					print(i + 1)
					break


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = -1
	mx = max(arr)
	for i in range(n):
		if arr[i] == mx and (i > 0 and arr[i] > arr[i - 1] or (i < n - 1 and arr[i] > arr[i + 1])):
			ans = i + 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	(mIn, mAx) = (min(l), max(l))
	if mIn == mAx:
		print(-1)
		continue
	for i in range(n):
		if l[i] == mAx:
			if i > 0 and l[i - 1] != mAx or (i < n - 1 and l[i + 1] != mAx):
				print(i + 1)
				break


def solve(arr, n):
	if len(set(arr)) == 1:
		return -1
	maxx = arr[0]
	tmp_idx = 0
	for i in range(1, len(arr)):
		if arr[i] > maxx:
			tmp_idx = i
			maxx = arr[i]
	if tmp_idx == 0 and arr[tmp_idx] == arr[tmp_idx + 1]:
		while arr[tmp_idx] == arr[tmp_idx + 1]:
			tmp_idx += 1
	if arr[tmp_idx] == arr[tmp_idx - 1] and arr[tmp_idx] == arr[tmp_idx + 1]:
		return -1
	return tmp_idx + 1

def main():
	t = int(input())
	for q_itr in range(t):
		n = int(input())
		arr = list(map(int, input().split()))
		print(solve(arr, n))
main()


for test in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	maxi = -float('inf')
	for i in arr:
		maxi = max(i, maxi)
	idx = -1
	for i in range(n):
		if arr[i] != maxi:
			continue
		if i > 0 and arr[i - 1] != maxi:
			idx = i + 1
		if i < n - 1 and arr[i + 1] != maxi:
			idx = i + 1
	print(idx)


t = int(input())

def check(arr, n, index, size):
	for i in range(index + 1, n):
		if size > arr[i]:
			size += 1
		else:
			return False
	for i in reversed(range(index)):
		if size > arr[i]:
			size += 1
		else:
			return False
	return True
while t > 0:
	t -= 1
	n = int(input())
	arr = [int(x) for x in input().split()]
	dict = {}
	maxi = 0
	for i in range(1, n - 1):
		if arr[i] > maxi:
			maxi = arr[i]
		if arr[i] > arr[i + 1] or arr[i] > arr[i - 1]:
			dict[arr[i]] = i
	if arr[0] > maxi:
		maxi = arr[0]
	if arr[0] > arr[1]:
		dict[arr[0]] = 0
	if arr[-1] > maxi:
		maxi = arr[-1]
	if arr[-1] > arr[-2]:
		dict[arr[-1]] = n - 1
	if len(dict) == 0:
		print(-1)
	for size in sorted(dict, reverse=True):
		if size == maxi:
			print(dict[size] + 1)
			break
		elif check(arr, n, dict[size], size) == True:
			print(dict[size] + 1)
			break


import sys
import math
from collections import defaultdict, Counter
input = sys.stdin.readline

def print(x):
	sys.stdout.write(str(x) + '\n')
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	ma = max(a)
	for j in range(n):
		if a[j] == ma:
			if j == 0:
				if a[j + 1] < a[j]:
					print(j + 1)
					break
			elif j == n - 1:
				if a[j - 1] < a[j]:
					print(j + 1)
					break
			elif a[j - 1] < a[j] or a[j + 1] < a[j]:
				print(j + 1)
				break
	else:
		print(-1)


for i in range(int(input())):
	n = int(input())
	lis = [int(x) for x in input().split()]
	if lis.count(lis[0]) == len(lis):
		print(-1)
		continue
	m = max(lis)
	x = 0
	for i in range(n):
		if lis[i] == m:
			if i > 0:
				if lis[i - 1] < m:
					x = i + 1
			if i < n - 1:
				if lis[i + 1] < m:
					x = i + 1
	print(x)


import typing

def rl(*args) -> typing.Iterable:
	(func, funcs) = (int, (int, float, str))
	(itr, itrs) = (iter, (iter, list, tuple, set))
	sep = ' '
	for a in args:
		if a in funcs:
			func = a
		elif a in itrs:
			itr = a
		elif isinstance(a, str):
			sep = a
	return itr(map(func, input().strip().split(sep)))
T = int(input())
while T:
	T -= 1
	n = int(input())
	xs = rl(tuple)
	sxs = set(xs)
	if len(sxs) == 1:
		print(-1)
	else:
		max_x = max(sxs)
		last_weak = False
		last_max = False
		for (i, x) in enumerate(xs, 1):
			if x != max_x:
				if last_max:
					print(i - 1)
					break
				last_weak = True
				last_max = False
				continue
			else:
				if last_weak:
					print(i)
					break
				last_max = True
				last_weak = False


import math
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	x = max(a)
	if a.count(x) == n:
		print(-1)
	else:
		p = a.index(x)
		if p == 0 and a[1] == x:
			for i in range(p + 1, n):
				if a[i + 1] < x:
					p = i
					break
		print(p + 1)


import sys, math
import io, os

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
mod = int(1000000000.0) + 7
for t in range(int(data())):
	n = int(data())
	a = mdata()
	m = max(a)
	ind = -1
	for i in range(n):
		if a[i] == m:
			if i > 0 and a[i - 1] < m:
				ind = i + 1
				break
			if i < n - 1 and a[i + 1] < m:
				ind = i + 1
				break
	out(ind)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	s = set(l)
	if len(s) == 1:
		print(-1)
	else:
		x = max(l)
		index = -1
		for i in range(1, n - 1):
			if l[i] == x and (l[i] > l[i - 1] or l[i] > l[i + 1]):
				index = i + 1
		if l[0] == x and l[0] > l[1]:
			index = 1
		if l[-1] == x and l[-1] > l[-2]:
			index = n
		print(index)


t = int(input())
for q in range(t):
	n = int(input())
	lst = list(map(int, input().split()))
	if lst.count(lst[0]) == n:
		print(-1)
	else:
		maxv = max(lst)
		for i in range(n):
			if i == 0:
				if lst[i] == maxv and lst[i + 1] != maxv:
					print(1)
					break
			elif i == n - 1:
				if lst[i] == maxv and lst[i - 1] != maxv:
					print(n)
					break
			elif lst[i] == maxv and (lst[i - 1] != maxv or lst[i + 1] != maxv):
				print(i + 1)
				break


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	if len(set(a)) == 1:
		print(-1)
	else:
		for i in range(n):
			if a[i] == m:
				if i >= 1 and a[i - 1] != m or (i < n - 1 and a[i + 1] != m):
					print(i + 1)
					break


from sys import stdin, stdout
from os import path
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
	stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

	def S():
		return stdin.readline().rstrip()

	def Sn():
		return stdin.readline().split(' ')

	def Out(whatever):
		return stdout.write(whatever)

def func(arr):
	k = max(arr)
	n = len(arr)
	for j in range(n):
		if arr[j] == k:
			if j > 0:
				if arr[j] > arr[j - 1]:
					return j + 1
			if j < n - 1:
				if arr[j] > arr[j + 1]:
					return j + 1
	return -1
q = I()
answers = ['     '] * q
for i in range(q):
	n = I()
	l = list(In())
	answers[i] = str(func(l))
Out('\n'.join(answers))


import math as mt
import bisect
import sys
input = sys.stdin.readline
t = int(input())
import collections
import heapq
p = 10 ** 9 + 7

def ncr_util():
	inv[0] = inv[1] = 1
	fact[0] = fact[1] = 1
	for i in range(2, 300001):
		inv[i] = inv[i % p] * (p - p // i) % p
	for i in range(1, 300001):
		inv[i] = inv[i - 1] * inv[i] % p
		fact[i] = fact[i - 1] * i % p

def solve():
	maxi = max(l)
	(ans1, ans2) = (-1, -1)
	for i in range(n):
		if l[i] == maxi:
			ind = i
			break
	for i in range(ind - 1, -1, -1):
		if l[i] != maxi:
			ans1 = i + 2
			break
	for i in range(ind + 1, n):
		if l[i] != maxi:
			ans2 = i
			break
	if ans1 == -1 and ans2 == -1:
		return -1
	if ans1 != -1:
		return ans1
	else:
		return ans2
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	print(solve())


def solve():
	n = int(input())
	a = [int(x) for x in input().split()]
	mx = -1
	ind = -1
	for i in range(0, n):
		mx = max(mx, a[i])
	for i in range(0, n):
		if a[i] == mx:
			if i > 0 and a[i - 1] != mx:
				ind = i + 1
			if i < n - 1 and a[i + 1] != mx:
				ind = i + 1
	if ind == -1:
		print(-1, '\n')
	else:
		print(ind, '\n')
test = int(input())
while test > 0:
	solve()
	test -= 1


for _ in range(int(input())):
	n = int(input())
	size = list(map(int, input().split()))
	hi = max(size)
	if size.count(hi) == n:
		print(-1)
		continue
	for i in range(n):
		if size[i] == hi:
			if i == 0:
				if size[1] != hi:
					print(1)
					break
			elif i == n - 1:
				if size[n - 2] != hi:
					print(n)
					break
			elif size[i - 1] != hi or size[i + 1] != hi:
				print(i + 1)
				break


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	if min(l) == m:
		print(-1)
		continue
	for j in range(n):
		if l[j] == m:
			if j != n - 1:
				if l[j + 1] < l[j]:
					print(j + 1)
					break
			if j != 0:
				if l[j - 1] < l[j]:
					print(j + 1)
					break


from collections import Counter
from typing import List

def solve(n: int, a: List[int]) -> int:
	c = Counter(a)
	if len(c) == 1:
		return -1
	max_val = max(c.keys())
	if a[0] == max_val:
		i = 0
		while a[i] == max_val:
			i += 1
		return i
	elif a[-1] == max_val:
		i = n - 1
		while a[i] == max_val:
			i -= 1
		return i + 2
	return a.index(max_val) + 1
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	r = solve(n, a)
	print(r)


t = int(input())
i = 0
while i < t:
	n = int(input())
	x = list(map(int, input().split()))
	index = 0
	valid = 1
	while index < n:
		if x[index] == x[0] and valid:
			index += 1
			continue
		else:
			valid = 0
			break
	if valid:
		print(-1)
	else:
		index = 1
		valid = 1
		maximum = x[0]
		I = 0
		while index < n:
			if x[index] > maximum:
				valid = 0
				I = index
				maximum = x[index]
			elif x[index] < maximum:
				valid = 0
			elif x[index] == maximum:
				if valid:
					x[index] = maximum
					I = index
			index += 1
		print(I + 1)
	i += 1


import sys
max_int = 1000000001
min_int = -max_int
t = int(input())
for _t in range(t):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	mx = -1
	out = -2
	la = len(a)
	for (i, one) in enumerate(a):
		if one >= mx:
			mx = one
			if i != 0 and a[i - 1] < a[i] or (i != la - 1 and a[i + 1] < a[i]):
				out = i
	print(out + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	req = max(a)
	cnt = 0
	ind = -1
	for i in range(n):
		if a[i] == req:
			cnt += 1
			if i > 0 and a[i] > a[i - 1] or (i < n - 1 and a[i] > a[i + 1]):
				ind = i + 1
	if cnt == n or ind == -1:
		print(-1)
	else:
		print(ind)


t = int(input())
for T in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	s = set(l)
	nl = list(s)
	nl.sort()
	x = -1
	y = max(l)
	for j in range(n):
		if l[j] == y:
			if j > 0 and j < n - 1:
				if l[j] > l[j - 1] or l[j] > l[j + 1]:
					x = j + 1
					break
			if j == 0 and l[j] > l[1]:
				x = 1
				break
			if j == n - 1 and l[j] > l[n - 2]:
				x = n
				break
	print(x)


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c for j in range(b)] for i in range(a)]

def list3d(a, b, c, d):
	return [[[d for k in range(c)] for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e for l in range(d)] for k in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** (-10)
for _ in range(INT()):
	N = INT()
	A = LIST()
	if len(set(A)) == 1:
		print(-1)
	else:
		mx = max(A)
		A = [INF] + A + [INF]
		ans = -1
		for i in range(1, N + 1):
			if A[i] == mx and (A[i - 1] < A[i] or A[i] > A[i + 1]):
				ans = i
				break
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	if len(list(set(l))) == 1:
		print(-1)
	else:
		i = l.index(max(l))
		j = i + 1
		while j < n and l[j] == l[i]:
			j += 1
		if j == n and l[j - 1] == l[i]:
			j = i + 1
		print(j)


import os
import sys
from io import BytesIO, IOBase
_str = str
BUFSIZE = 8192

def str(x=b''):
	return x if type(x) is bytes else _str(x).encode()

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def inp():
	return sys.stdin.readline().rstrip()

def mpint():
	return map(int, inp().split(' '))

def itg():
	return int(inp())

def solve():
	n = itg()
	arr = tuple(mpint())
	mx = max(arr)
	for i in range(n):
		if arr[i] != mx:
			continue
		lf = i - 1
		rg = i + 1
		if lf != -1 and arr[lf] != mx:
			return i + 1
		if rg != n and arr[rg] != mx:
			return i + 1
	return -1

def main():
	for _ in range(itg()):
		print(solve())
DEBUG = 0
URL = 'https://codeforces.com/contest/1433/problem/B'
if DEBUG == 1:
	import requests
	from ACgenerator.Y_Test_Case_Runner import TestCaseRunner
	runner = TestCaseRunner(main, URL)
	inp = runner.input_stream
	print = runner.output_stream
	runner.checking()
elif DEBUG == 2:
	main()
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	main()


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
		continue
	r = max(l)
	for j in range(n - 1):
		if (l[j] == r or l[j + 1] == r) and l[j] != l[j + 1]:
			if l[j] > l[j + 1]:
				print(j + 1)
			else:
				print(j + 2)
			break


for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	index = -1
	ans = max(lst)
	for i in range(n):
		if lst[i] == ans and (i > 0 and lst[i - 1] < lst[i] or (i < n - 1 and lst[i + 1] < lst[i])):
			index = i + 1
	print(index)


import sys
input = lambda : sys.stdin.readline().rstrip()
from collections import deque
from queue import LifoQueue

def binary_search(a, n):
	L = 0
	R = len(a) - 1
	while L <= R:
		mid = L + (R - L) // 2
		if a[mid] == n:
			return mid
		elif a[mid] < n:
			L = mid + 1
		else:
			R = mid - 1
	return -1
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	maxi = max(a)
	if maxi == min(a):
		print(-1)
	else:
		for i in range(len(a) - 1):
			if a[i] == maxi and a[i + 1] != maxi:
				print(i + 1)
				break
			elif a[i + 1] == maxi and a[i] != maxi:
				print(i + 2)
				break


q = int(input())
for _ in range(q):
	n = int(input())
	st = input().split()
	maX = 0
	miN = 1000000000
	ids_maX = []
	ids_miN = []
	for (i, x) in enumerate(list(map(int, st))):
		if x > maX:
			maX = x
			ids_maX = [i]
		elif x == maX:
			ids_maX.append(i)
		if x < miN:
			miN = x
			ids_miN = [i]
		elif x == miN:
			ids_miN.append(i)
	if miN == maX:
		print(-1)
	elif len(ids_maX) > 2 or (len(ids_maX) > 1 and ids_maX[0] == 0 and (ids_maX[1] == 1)) or (len(ids_maX) > 1 and ids_maX[-1] == len(st) - 1 and (ids_maX[-2] == len(st) - 2)):
		for x in ids_maX:
			if 0 < x < len(st) - 1:
				if int(st[x - 1]) != maX or int(st[x + 1]) != maX:
					print(x + 1)
					break
			elif x == 0:
				if int(st[x + 1]) != maX:
					print(x + 1)
					break
			elif x == len(st) - 1:
				if int(st[x - 1]) != maX:
					print(x + 1)
					break
	else:
		print(ids_maX[0] + 1)


from math import *
import threading
import sys

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = -1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def graph(n, m):
	adj = dict()
	for i in range(1, n + 1):
		adj.setdefault(i, 0)
	for i in range(m):
		(a, b) = map(int, input().split())
		adj[a] += 1
		adj[b] += 1
	return adj

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	li = []
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, len(prime)):
		if prime[p]:
			li.append(p)
	return li
INF = 1000000000.0
primes = SieveOfEratosthenes(1300000)

def fn(n):
	i = 2
	res = n - 1
	val = 0
	for i in range(int(sqrt(n)) + 1, 1, -1):
		val = i - 1 + int(ceil((n - i) / i))
		if val <= res:
			res = val
		else:
			break
	return res

def solve(a, b, c):
	dis = b ** 2 - 4 * a * c
	ans1 = (-b - sqrt(dis)) / (2 * a)
	print(int(ans1))
	return
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	maxcount = a.count(max(a))
	if maxcount == n:
		print(-1)
	else:
		ans = -1
		maxelem = max(a)
		for i in range(1, n - 1):
			if a[i] == maxelem:
				if a[i - 1] < a[i] or a[i + 1] < a[i]:
					ans = i
					break
		if ans == -1:
			if a[0] == maxelem and a[0] > a[1]:
				ans = 0
			elif a[n - 1] == maxelem and a[n - 1] > a[n - 2]:
				ans = n - 1
		print(ans + 1)


for _ in range(int(input())):
	n = input()
	a = list(map(int, input().split()))
	if a.count(max(a)) == len(a):
		print(-1)
		continue
	mx = max(a)
	flag = False
	for i in range(len(a)):
		if i == 0:
			if a[i] == mx and a[i + 1] < mx:
				print(i + 1)
				flag = True
				break
		elif i == len(a) - 1:
			if a[i] == mx and a[i - 1] < mx:
				print(i + 1)
				flag = True
				break
		elif a[i] == mx and (a[i - 1] < mx or a[i + 1] < mx):
			print(i + 1)
			flag = True
			break
	if not flag:
		print(-1)


from collections import Counter
from collections import OrderedDict
from collections import defaultdict
import bisect

def freq_count(mylist):
	return Counter(mylist)
t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	maxa = max(arr)
	for i in range(n):
		if i == 0:
			if arr[i] == maxa and arr[i] > arr[i + 1]:
				print(i + 1)
				break
		elif i == n - 1:
			if arr[i] == maxa and arr[i] > arr[i - 1]:
				print(i + 1)
				break
		elif arr[i] == maxa:
			if arr[i] > arr[i - 1] or arr[i] > arr[i + 1]:
				print(i + 1)
				break
	else:
		print('-1')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	mx = 0
	for i in range(n):
		mx = max(mx, a[i])
	index = -1
	for i in range(n):
		if a[i] == mx:
			flag = True
			if (i - 1 >= 0 and a[i - 1] == a[i]) and (i + 1 < n and a[i + 1] == a[i]):
				flag = False
			elif i == 0 and a[i + 1] == a[i]:
				flag = False
			elif i == n - 1 and a[i - 1] == a[i]:
				flag = False
			if flag:
				index = i + 1
				break
	print(index)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	if a.count(mx) == n:
		ans = -1
	else:
		flag = 0
		for i in range(n):
			if a[i] == mx:
				if i < n - 1 and a[i + 1] != mx:
					ans = i + 1
					flag = 1
				elif i > 0 and a[i - 1] != mx:
					ans = i + 1
					flag = 1
			if flag:
				break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	mx = max(arr)
	if len(set(arr)) == 1:
		print(-1)
	else:
		ans = -1
		for i in range(len(arr)):
			if arr[i] == mx:
				if i - 1 > -1 and arr[i - 1] < mx:
					ans = i
					break
				elif i + 1 < n and arr[i + 1] < mx:
					ans = i
					break
		print(ans + 1)


def mi():
	return map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	a = list(mi())
	ma = max(a)
	mii = min(a)
	if mii == ma:
		print(-1)
		continue
	for i in range(n):
		if a[i] == ma:
			if i > 0 and a[i - 1] < ma or (i < n - 1 and a[i + 1] < ma):
				print(i + 1)
				break


for k in range(int(input())):
	h = input()
	l = [int(i) for i in input().split()]
	z = max(l)
	f = 0
	if len(set(l)) == 1:
		print(-1)
	elif l.count(z) == 1:
		print(l.index(z) + 1)
	else:
		for i in range(len(l)):
			if f == 1:
				break
			if i == 0:
				if l[i] == z:
					if l[i + 1] < z:
						f = 1
						print(i + 1)
						continue
			if i == len(l) - 1:
				if l[i] == z:
					if l[i - 1] < z:
						f = 1
						print(i + 1)
						continue
			if 0 < i < len(l) - 1:
				if l[i] == z:
					if l[i + 1] < z or l[i - 1] < z:
						f = 1
						print(i + 1)
						continue


import math
import sys
import collections
import bisect
input = sys.stdin.readline
flush = sys.stdout.flush
readint = lambda : int(input())
readintm = lambda : map(int, input().strip().split())
readintl = lambda : list(map(int, input().strip().split()))
readfloatm = lambda : map(float, input().strip().split())
readfloatl = lambda : list(map(float, input().strip().split()))
readstr = lambda : input().strip()
readstrl = lambda : list(input().strip())
join = lambda x, l: x.join(map(str, l))
print = lambda *x: sys.stdout.write(' '.join(map(str, x)) + '\n')
printl = lambda l: sys.stdout.write(' '.join(map(str, l)) + '\n')
ceil = lambda x, y: (x + y - 1) // y
mod = 1000000007

def ans(nums, n, high):
	if nums[0] == high and nums[0] > nums[1]:
		return 1
	elif nums[-1] == high and nums[-1] > nums[-2]:
		return n
	else:
		for i in range(1, n - 1):
			if nums[i] == high and (nums[i] > nums[i - 1] or nums[i] > nums[i + 1]):
				return i + 1
	return -1
for _ in range(readint()):
	n = readint()
	nums = readintl()
	high = max(nums)
	print(ans(nums, n, high))


t = int(input())

def solve():
	n = int(input())
	a = []
	s = input()
	for i in s.split():
		x = int(i)
		a.append(x)
	m = -2
	if a[0] > a[1]:
		m = 0
	if a[0] <= a[n - 1] and a[n - 1] > a[n - 2]:
		m = n - 1
	for i in range(1, n - 1):
		if (a[i] > a[i - 1] or a[i] > a[i + 1]) and (a[m] < a[i] or m == -2):
			m = i
	print(m + 1)
while t > 0:
	solve()
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	maxx = -1
	ind = -2
	for i in range(n):
		if a[i] >= maxx and (i != 0 and a[i] > a[i - 1] or (i != n - 1 and a[i] > a[i + 1])):
			ind = i
			maxx = a[i]
	print(ind + 1)


t = int(input())
ans = ''
for j in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	M = a[0]
	M_pos = 0
	for i in range(1, n):
		if M < a[i]:
			M = a[i]
			M_pos = i + 1
		elif M > a[i] and M == a[i - 1]:
			M_pos = i
		elif M == a[i] and M > a[i - 1]:
			M_pos = i + 1
	if M_pos == 0:
		ans += '-1 \n'
	else:
		ans += str(M_pos) + '\n'
print(ans)


def find_dominant(fishes):
	mxm = max(fishes)
	lng = len(fishes)
	i = 0
	for i in range(lng):
		prev = fishes[i - 1] if i > 0 else None
		next = fishes[i + 1] if i < lng - 1 else None
		if fishes[i] == mxm and (i and (i < lng - 1 and (prev < mxm or next < mxm) or (i == lng - 1 and prev < mxm)) or (not i and next < mxm)):
			return i
	return -1
for test in range(int(input())):
	m = int(input())
	fishes = list(map(int, input().split()))[:m]
	result = find_dominant(fishes)
	print(result + 1 if result >= 0 else result)


from sys import stdin, stdout

class SOLVE:

	def solve(self):
		R = stdin.readline
		W = stdout.write
		ans = []
		for i in range(int(R())):
			n = int(R())
			a = [int(x) for x in R().split()]
			if len(set(a)) == 1:
				ans.append('-1')
			else:
				mx = max(a)
				flg = 1
				for j in range(1, n):
					if a[j - 1] < a[j] and a[j] == mx:
						ans.append(str(j + 1))
						flg = 0
						break
				if flg:
					for j in range(n - 1):
						if a[j] > a[j + 1] and a[j] == mx:
							ans.append(str(j + 1))
							break
		W('\n'.join(ans))
		return 0

def main():
	s = SOLVE()
	s.solve()
main()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) < 2:
		print(-1)
	else:
		m = l.index(max(l))
		if m - 1 > -1:
			print(m + 1)
		else:
			while m + 1 < n:
				if l[m + 1] != l[m]:
					break
				m = m + 1
			print(m + 1)


for _ in range(int(input())):
	n = int(input())
	k = [int(j) for j in input().split()]
	index = -1
	mx = max(k)
	for i in range(n):
		if k[i] != mx:
			continue
		if i > 0 and k[i - 1] != mx:
			index = i + 1
		if i < n - 1 and k[i + 1] != mx:
			index = i + 1
	print(index)


game = int(input())
for i in range(game):
	n = int(input())
	k = list(map(int, input().split()))
	l = [k[0]] * n
	if k == l:
		print(-1)
	else:
		m = max(k)
		if k[0] == m and k[0] > k[1]:
			print(1)
		elif k[n - 1] == m and k[n - 1] > k[n - 2]:
			print(n)
		else:
			for j in range(1, n - 1):
				if k[j] == m and k[j] > k[j - 1]:
					print(j + 1)
					break
				elif k[j] == m and k[j] > k[j + 1]:
					print(j + 1)
					break


def solve(piranhas):
	current_biggest = 0
	current_ans = -1
	piranhas = [2 ** 31, *piranhas, 2 ** 31]
	for i in range(1, len(piranhas) - 1):
		if piranhas[i] >= current_biggest:
			current_biggest = piranhas[i]
			if piranhas[i - 1] < current_biggest or current_biggest > piranhas[i + 1]:
				current_ans = i
	return current_ans
for t in range(int(input())):
	n = int(input())
	print(solve(list(map(int, input().split()))))


def solve():
	n = int(input())
	arr = [int(v) for v in input().split()]
	mx = max(arr)
	for i in range(n):
		if arr[i] == mx and (i > 0 and arr[i - 1] < arr[i] or (i < n - 1 and arr[i + 1] < arr[i])):
			print(i + 1)
			return
	print(-1)
t = int(input())
for _ in range(t):
	solve()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if n == 2:
		if l[0] == l[1]:
			print(-1)
		else:
			print(l.index(max(l)) + 1)
	else:
		valid_ps = []
		if l[-2] < l[-1]:
			valid_ps.append(n - 1)
		if l[0] > l[1]:
			valid_ps.append(0)
		for i in range(1, n - 1):
			if l[i - 1] < l[i] and l[i + 1] <= l[i] or (l[i + 1] < l[i] and l[i - 1] <= l[i]):
				valid_ps.append(i)
		if len(valid_ps) == 0:
			print(-1)
			continue
		print(max(valid_ps, key=lambda x: l[x]) + 1)


def count(array, l):
	comp = 0
	for i in range(l - 1):
		if array[i] == array[i + 1]:
			comp += 1
	if comp == l - 1:
		return -1
	elif l == 1:
		return 1
	else:
		m = max(array)
		steps = 0
		for i in range(l - 1):
			if array[i] == m and array[i] != array[i + 1]:
				return i + 1
		for i in range(l):
			if array[i] == m:
				return i + 1
T = int(input())
for i in range(T):
	l = int(input())
	array = list(map(int, input().split()))
	print(count(array, l))


def main():
	n = int(input())
	arr = list(map(int, input().split()))
	m = max(arr)
	for i in range(n):
		if arr[i] == m:
			if i > 0 and arr[i - 1] < m:
				print(i + 1)
				return
			elif i + 1 < n and arr[i + 1] < m:
				print(i + 1)
				return
	print(-1)
for _ in range(int(input())):
	main()


for s in [*open(0)][2::2]:
	a = list(map(int, s.split()))
	m = max(a)
	for i in range(1, len(a)):
		if a[i] > a[i - 1] and a[i] == m or (a[i] < a[i - 1] and a[i - 1] == m):
			print(i + (a[i] == m))
			break
	else:
		print(-1)


import sys
import math
import bisect
from sys import stdin, stdout
from math import floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
mod = 1000000007

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def mod_inverse(a, n):
	N = n
	xx = 0
	yy = 1
	y = 0
	x = 1
	while n > 0:
		q = a // n
		t = n
		n = a % n
		a = t
		t = xx
		xx = x - q * xx
		x = t
		t = yy
		yy = y - q * yy
		y = t
	x %= N
	x += N
	x %= N
	return x

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	return prime

def solve():
	n = int(input())
	l = [int(i) for i in input().split()][:n]
	x = set(l)
	if len(x) == 1:
		print(-1)
	else:
		temp = max(l)
		for i in range(1, n - 1):
			if l[i] == temp and (l[i - 1] != temp or l[i + 1] != temp):
				print(i + 1)
				break
		else:
			if l[0] == temp:
				print(1)
			else:
				print(n)
testcase = int(sys.stdin.readline())
for _ in range(testcase):
	solve()


t = int(input())
for _ in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	if len(set(li)) == 1:
		print(-1)
	else:
		x = max(li)
		li.insert(0, x)
		li.append(x)
		for i in range(1, n + 1):
			if li[i - 1] == x and li[i + 1] != x and (li[i] == x):
				print(i)
				break
			if li[i - 1] != x and li[i + 1] == x and (li[i] == x):
				print(i)
				break
			if li[i - 1] != x and li[i + 1] != x and (li[i] == x):
				print(i)
				break


t = int(input())

def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print(-1)
	else:
		m = max(arr)
		for i in range(n):
			if i == n - 1 and arr[i] == m:
				print(i + 1)
				break
			if i < n - 1:
				if arr[i + 1] != m and arr[i] == m:
					print(i + 1)
					break
			if i > 0:
				if arr[i - 1] != m and arr[i] == m:
					print(i + 1)
					break
for i in range(t):
	solve()


t = int(input())
for _ in range(t):
	n = int(input())
	my_list = list(map(int, input().split(' ')))
	if [my_list[0]] * len(my_list) == my_list:
		print(-1)
	else:
		maximum = max(my_list)
		max_list = [i for i in range(n) if my_list[i] == maximum]
		for i in range(len(max_list)):
			curr_ind = max_list[i]
			condition_one = curr_ind - 1 >= 0 and my_list[curr_ind - 1] < maximum
			condition_two = curr_ind + 1 <= n - 1 and my_list[curr_ind + 1] < maximum
			if condition_one or condition_two:
				print(curr_ind + 1)
				break


tc = int(input())
for k in range(tc):
	N = int(input())
	A = [int(n) for n in input().split()]
	mx = 0
	al = True
	for i in range(N):
		mx = max(mx, A[i])
		if i - 1 >= 0:
			al = al and A[i] == A[i - 1]
	if al:
		print(-1)
		continue
	for i in range(N):
		al = A[i] == mx
		if A[i] == mx:
			if i + 1 < N and A[i + 1] != mx:
				print(i + 1)
				break
			if i - 1 >= 0 and A[i - 1] != mx:
				print(i + 1)
				break


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print(-1)
		continue
	ind = -1
	maxx = 0
	for i in range(n):
		if maxx <= arr[i]:
			maxx = arr[i]
			ind = i
	if ind + 1 == n:
		i = n - 1
		while arr[i] == arr[i - 1]:
			i -= 1
		ind = i
	print(ind + 1)


n = int(input())
for i in range(n):
	x = int(input())
	ps = list(map(int, input().split()))
	if len(set(ps)) == 1:
		print(-1)
	else:
		maxx = 0
		first = 0
		ans = None
		for j in range(len(ps)):
			if ps[j] > maxx:
				maxx = ps[j]
				first = j
			if ps[j] == maxx and (j + 1 < len(ps) and ps[j + 1] < maxx or (j != 0 and ps[j - 1] < maxx)):
				ans = j
		print(ans + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	list1 = list(map(int, input().strip().split()))
	index = -1
	temp = max(list1)
	for i in range(n):
		if list1[i] == temp:
			if i - 1 >= 0 and list1[i - 1] < temp or (i + 1 < n and list1[i + 1] < temp):
				index = i + 1
				break
	print(index)


import sys

def main():
	t = Iint()
	for _ in range(t):
		n = Iint()
		a = Ilist()
		if a == [a[0]] * n:
			print(-1)
		else:
			ma = max(a)
			for (i, ai) in en(a):
				if ai == ma:
					if i > 0 and a[i - 1] < ma or (i < n and a[i + 1] < ma):
						print(i + 1)
						break
en = enumerate
FIO = 10

def debug(*args, c=6):
	pass
	print('\x1b[3{}m'.format(c), *args, '\x1b[0m', file=sys.stderr)
BUFSIZE = 8 * 1024

def Istr():
	return input()

def Iint():
	return int(input())

def Ilist():
	return list(map(int, input().split()))

def Imap():
	return map(int, input().split())

def Plist(li, s=' '):
	print(s.join(map(str, li)))
if not FIO:
	if __name__ == '__main__':
		main()
		exit()
else:
	from io import BytesIO, IOBase
	import os

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	a = max(l)
	b = min(l)
	if a == b:
		print('-1')
	else:
		for j in range(n):
			if l[j] == a:
				if j > 0 and l[j - 1] < a:
					print(j + 1)
					break
				elif j < n - 1 and l[j + 1] < a:
					print(j + 1)
					break


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a_max = max(a)
	index = None
	i = 0
	while i < n and (not index):
		if a[i] == a_max:
			if i - 1 >= 0 and a[i - 1] < a[i]:
				index = i
			if i + 1 < n and a[i + 1] < a[i]:
				index = i
		i += 1
	print(index + 1 if index != None else -1)


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	n2 = min(l)
	if m == n2:
		print(-1)
	else:
		j = l.index(m) + 1
		if j == 1:
			while j <= n - 1 and l[j] == m:
				j += 1
		print(j)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
	else:
		l.append(-1)
		ans = n
		if l[0] > l[1]:
			ans = 0
		if l[n - 1] > l[n - 2] and l[n - 1] > l[ans]:
			ans = n - 1
		for i in range(1, n - 1):
			if l[i] > l[ans]:
				if l[i] > l[i + 1] or l[i] > l[i - 1]:
					ans = i
		print(ans + 1)


def eatReturn(index, myList):
	if index > 0 and myList[index] > myList[index - 1]:
		return True
	elif index < len(myList) - 1 and myList[index] > myList[index + 1]:
		return True
	return False
t = int(input())
for i in range(t):
	size = int(input())
	createdList = input().split()
	dominate = False
	for i in range(size):
		createdList[i] = int(createdList[i])
	bigChungus = createdList[0]
	for i in createdList:
		if i > bigChungus:
			bigChungus = i
	for i in range(size):
		if createdList[i] == bigChungus:
			if eatReturn(i, createdList):
				print(i + 1)
				dominate = True
				break
	if not dominate:
		print(-1)


for _ in range(int(input())):
	x = int(input())
	l = list(map(int, input().split()))
	m = l.index(max(l))
	ans = 0
	bool = False
	for num in range(x):
		if m - 1 in range(x):
			if l[m - 1] < l[m]:
				ans = m + 1
				bool = True
				break
			elif m + 1 in range(x) and l[m + 1] < l[m]:
				ans = m + 1
				bool = True
				break
			else:
				m += 1
		elif m + 1 in range(x):
			if l[m + 1] < l[m]:
				ans = m + 1
				bool = True
				break
			else:
				m += 1
	if len(l) == 1:
		print(1)
	elif bool:
		print(ans)
	else:
		print(-1)


T = int(input())

def ans(a):
	m = max(a)
	for i in range(len(a)):
		if i > 0 and i < len(a) - 1:
			if a[i] == m:
				if a[i - 1] < m or a[i + 1] < m:
					return i + 1
		elif i == 0:
			if a[i] == m and a[i + 1] < m:
				return i + 1
		elif a[i] == m and a[i - 1] < m:
			return i + 1
	return -1
for z in range(T):
	n = int(input())
	a = [int(x) for x in input().split()]
	print(ans(a))


test_cases = int(input())
res = []
for test in range(test_cases):
	n = int(input())
	st = input()
	lst = st.split()
	n_lst = []
	mx = -1
	for i in lst:
		n_lst.append(int(i))
		if n_lst[-1] > mx:
			mx = n_lst[-1]
	res.append(-1)
	for i in range(len(n_lst)):
		if n_lst[i] == mx:
			if i != 0:
				if n_lst[i - 1] < mx:
					res[-1] = i + 1
					break
			if i < len(n_lst) - 1:
				if n_lst[i + 1] < mx:
					res[-1] = i + 1
					break
for test in range(test_cases):
	print(res[test])


def ans(a, n):
	x = max(a)
	if a[0] == x and a[0] > a[1]:
		return 1
	for i in range(1, n - 1):
		if a[i] == x:
			if a[i] > a[i + 1] or a[i] > a[i - 1]:
				return i + 1
	if a[n - 1] > a[n - 2]:
		return n
	return -1
for _ in range(int(input())):
	n = int(input())
	c = 0
	x = []
	l = list(map(int, input().split()))
	res = ans(l, n)
	print(res)


for k in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	minimum = 10 ** 9 + 1
	maximum = 0
	for i in range(n):
		if a[i] > maximum:
			maximum = a[i]
		if a[i] < minimum:
			minimum = a[i]
	if maximum == minimum:
		print(-1)
	else:
		maximum_index = []
		for j in range(n):
			if a[j] == maximum:
				maximum_index.append(j)
		if len(maximum_index) == 1:
			print(maximum_index[0] + 1)
		elif maximum_index[len(maximum_index) - 1] < n - 1:
			print(maximum_index[len(maximum_index) - 1] + 1)
		elif maximum_index[0] > 0:
			print(maximum_index[0] + 1)
		else:
			accept = 1
			for i in range(len(maximum_index) - 1, 0, -1):
				if maximum_index[i] - maximum_index[i - 1] > 1:
					print(maximum_index[i] + 1)
					break


def domi_pira(arr):
	if len(set(arr)) == 1:
		return -1
	m = max(arr)
	if arr[0] == m and arr[1] < arr[0]:
		return 1
	elif arr[-1] == m and arr[-2] < arr[-1]:
		return len(arr)
	for i in range(len(arr)):
		if arr[i] == m and i + 1 < len(arr) and (i - 1 >= 0) and (arr[i - 1] < m or arr[i + 1] < m):
			return i + 1
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(domi_pira(arr))


for _ in range(int(input())):
	n = int(input())
	a = [*map(int, input().split())]
	if len(set(a)) == 1:
		print(-1)
	else:
		m = max(a)
		for i in range(n):
			if a[i] == m:
				if i < n - 1 and a[i] > a[i + 1] or (i > 0 and a[i] > a[i - 1]):
					print(i + 1)
					break


def print_result(ans):
	print(ans)

def solve(num_arr, n):
	MAX = max(num_arr)
	max_arr = [i for i in range(len(num_arr)) if num_arr[i] == MAX]
	if len(max_arr) == n:
		return -1
	elif max_arr[0] != 0:
		return max_arr[0] + 1
	elif max_arr[-1] != n - 1:
		return max_arr[-1] + 1
	else:
		for i in range(len(max_arr)):
			if max_arr[i] != i:
				if max_arr[i] == n - 1:
					return n
				else:
					return max_arr[i] + 1
	return -1
t = int(input())
for i in range(1, t + 1):
	n = int(input())
	num_arr = list(map(int, input().split()))
	ans = solve(num_arr, n)
	print_result(ans)


t = int(input())
j = 0
while j < t:
	j = j + 1
	y = int(input())
	x = [int(i) for i in input().split()]
	z = x.copy()
	z.sort(reverse=True)
	i = 1
	n = x.index(z[0])
	if n == 0:
		while i < y:
			if z[0] == z[-1]:
				print(-1)
				break
			elif x[n] == x[n + 1]:
				n = n + 1
			elif x[n] > x[n + 1]:
				print(n + 1)
				break
			else:
				print(-1)
	else:
		print(n + 1)


def solve(n, arr):
	m = max(arr)
	for i in range(1, n):
		if arr[i] == m and arr[i - 1] != m:
			return i + 1
	for i in range(n - 1):
		if arr[i] == m and arr[i + 1] != m:
			return i + 1
	return -1
t = int(input())
while t:
	n = int(input())
	arr = list(map(int, input().split()))
	print(solve(n, arr))
	t -= 1


for _ in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	zi = list(sorted(li))
	mini = zi[0]
	maxi = zi[-1]
	if mini != maxi:
		for i in range(n):
			if li[i] == maxi:
				if i < n - 1:
					if li[i + 1] != maxi:
						print(i + 1)
						break
				if i > 0:
					if li[i - 1] != maxi:
						print(i + 1)
						break
	else:
		print(-1)
		continue


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = -179
	check = True
	for i in range(n):
		if a[i] > m:
			m = a[i]
			l = i
			r = i
			check = True
		elif a[i] == m and check:
			r = i
		else:
			check = False
	if a.count(m) == n:
		print(-1)
	elif l != 0 or r == l:
		print(l + 1)
	else:
		print(r + 1)


quant = int(input())
for i in range(0, quant):
	quantity = int(input())
	count = list(map(int, input().split()))
	minimum = min(count)
	maximum = max(count)
	if minimum == maximum:
		print('-1')
	else:
		i = count.index(minimum)
		if count.index(minimum) > count.index(maximum):
			while count[i] != maximum:
				i = i - 1
		else:
			while count[i] != maximum:
				i = i + 1
		print(i + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	xs = list(map(int, input().split()))
	minx = min(xs)
	maxx = max(xs)
	if minx == maxx:
		print(-1)
	else:
		result = 0
		for ind in range(n - 1):
			x = xs[ind]
			y = xs[ind + 1]
			if x == maxx and x > y:
				result = ind
				break
			elif y == maxx and x < y:
				result = ind + 1
				break
		print(result + 1)


for t in range(int(input())):
	n = int(input())
	arr = [int(k) for k in input().split()]
	arr.append(10 ** 9)
	arr.insert(0, 10 ** 9)
	lmax = 0
	ans = -1
	for i in range(1, n + 1):
		if arr[i] > lmax and (arr[i] > arr[i - 1] or arr[i] > arr[i + 1]):
			ans = i
			lmax = arr[i]
	print(ans)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	p = max(l)
	res = 0
	s = []
	f = 0
	for i in range(n):
		if l[i] == p:
			s.append(i)
	s.append(n)
	if len(s) == 2:
		f = 1
		print(s[0] + 1)
	else:
		for i in range(1, len(s)):
			if s[i] - s[i - 1] > 1:
				if s[i - 1] == 0 or l[s[i - 1] - 1] < l[s[i - 1]] or l[s[i - 1] + 1] < l[s[i - 1]]:
					f = 1
					print(s[i - 1] + 1)
					break
	if f == 0:
		if s[0] != n and (l[s[0] - 1] < l[s[0]] or l[s[0] + 1] < l[s[0]]):
			print(s[0] + 1)
		else:
			print(-1)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		c = -1
	else:
		b = max(a)
		for j in range(len(a) - 2, 0, -1):
			if a[j] == b and (a[j + 1] < b or a[j - 1] < b):
				c = j + 1
				break
		else:
			if a.index(b) == 0 and a[1] < b:
				c = 1
			else:
				c = len(a)
	print(c)


a = int(input())
for i in range(0, a):
	t = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print(-1)
	else:
		k = 0
		m = max(arr)
		for i in range(1, len(arr) - 1):
			if arr[i] == m and (arr[i - 1] < m or arr[i + 1] < m):
				print(i + 1)
				k = 1
				break
		if k == 0:
			if arr[0] == m:
				if arr[1] < m:
					print(1)
			else:
				print(len(arr))


import os
import sys
from io import BytesIO, IOBase
import math

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countcon(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c
for xyz in range(0, int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
	else:
		ind = l.index(max(l))
		ma = max(l)
		if ind == 0 and l[ind + 1] == max(l):
			for i in range(0, n):
				if l[i] != ma:
					print(i)
					break
		else:
			print(ind + 1)


t = int(input())
while t:
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	y = -1
	if a[0] == m and a[1] < m:
		y = 1
	for x in range(1, n - 1):
		if a[x] == m and a[x + 1] < m:
			y = x + 1
			break
		if a[x] == m and a[x - 1] < m:
			y = x + 1
			break
	if a[n - 1] == m and a[n - 2] < m:
		y = n
	print(y)
	t -= 1


cases = int(input())
for _ in range(cases):
	n = int(input())
	c = list(map(int, input().split()))
	if c.count(c[0]) == len(c):
		print(-1)
	else:
		v = max(c)
		m = []
		for i in range(len(c)):
			if c[i] == v:
				m.append(i + 1)
		if len(m) == 1:
			print(m[0])
		else:
			v = -1
			for i in range(1, len(m)):
				if m[i] - m[i - 1] > 1:
					v = m[i]
					break
			if v == -1:
				if m[-1] < n:
					print(m[-1])
				else:
					print(m[0])
			else:
				print(v)


import sys
import math
input = sys.stdin.readline

def algo(n, arr):
	mx = max(arr)
	ans = -1
	for i in range(n):
		if arr[i] == mx:
			if i - 1 >= 0 and arr[i - 1] != mx:
				ans = i + 1
				break
			if i + 1 < n and arr[i + 1] != mx:
				ans = i + 1
				break
	return ans
for _ in range(int(input())):
	n = int(input().strip())
	arr = list(map(int, input().split()))
	res = algo(n, arr)
	print(res)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
	else:
		d = max(l)
		for i in range(n):
			if l[i] == d:
				if i == 0:
					if l[i + 1] == d:
						pass
					else:
						print(i + 1)
						break
				elif i == n - 1:
					if l[i - 1] == d:
						pass
					else:
						print(i + 1)
						break
				elif l[i - 1] != d or l[i + 1] != d:
					print(i + 1)
					break
				else:
					pass


t = int(input())
for i in range(t):
	n = int(input())
	l = [int(i) for i in input().split()]
	if len(set(l)) == 1:
		print(-1)
	else:
		x = max(l)
		for j in range(n):
			if l[j] == x and (l[j] > l[min(j + 1, n - 1)] or l[j] > l[max(0, j - 1)]):
				print(j + 1)
				break


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) == 1:
		print(-1)
		continue
	mx = max(a)
	if a[0] == mx and a[1] != mx:
		print(1)
		continue
	if a[-1] == mx and a[-2] != mx:
		print(n)
		continue
	for i in range(1, n - 1):
		if a[i] == mx and (a[i - 1] != mx or a[i + 1] != mx):
			print(i + 1)
			break


tsts = int(input())
for tst in range(tsts):
	ln = int(input())
	prns = list(map(int, input().split(' ')))
	big = max(prns)
	dom = -1
	if prns[0] != big:
		for i in range(ln):
			if prns[i] == big:
				dom = i + 1
				break
	else:
		for j in range(ln):
			if prns[j] != big:
				dom = j
				break
	print(dom)


n = int(input())

def test(items):
	aim = max(items)
	for (idx, item) in enumerate(items):
		if item == aim:
			if idx == 0:
				if len(items) > 1 and item > items[idx + 1]:
					return idx + 1
			elif idx == len(items) - 1:
				if item > items[idx - 1]:
					return idx + 1
			elif item > items[idx - 1] or item > items[idx + 1]:
				return idx + 1
	return -1
for _ in range(n):
	_ = input()
	items = tuple(map(int, input().split()))
	print(test(items))


def ans(a):
	if len(set(a)) == 1:
		return -1
	mx = max(a)
	for i in range(len(a)):
		if a[i] == mx:
			if i > 0 and a[i - 1] != a[i]:
				return i + 1
			if i < len(a) - 1 and a[i] != a[i + 1]:
				return i + 1
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print(ans(a))


for i in range(int(input())):
	n = int(input())
	s = input()
	if len(s.replace(s[:s.index(' ')], '').strip()) == 0:
		print(-1)
	else:
		ip = list(map(int, s.split()))
		m = max(ip)
		for i in range(len(ip)):
			if ip[i] == m and ip[i + 1] != m:
				print(i + 1)
				break
			if ip[i] != m and ip[i + 1] == m:
				print(i + 2)
				break


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	if a.count(m) < n:
		a.insert(0, m)
		a.append(m)
		for t in range(1, n + 1):
			if a[t] == m and (a[t] > a[t - 1] or a[t] > a[t + 1]):
				print(t)
				break
	else:
		print(-1)


def apt(n, arr):
	temp = max(arr)
	index = -1
	for i in range(n):
		if i == 0 and arr[i] == temp and (arr[i + 1] != temp):
			index = i + 1
		elif i == n - 1 and arr[i] == temp and (arr[i - 1] != temp):
			index = i + 1
		elif (i != 0 and i != n - 1) and arr[i] == temp and (arr[i - 1] != temp or arr[i + 1] != temp):
			index = i + 1
	return index
t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(apt(n, arr))


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	maximum = max(arr)
	ans = -1
	for i in range(n):
		if arr[i] == maximum:
			if i >= 1 and arr[i] > arr[i - 1] or (i < n - 1 and arr[i] > arr[i + 1]):
				ans = i + 1
				break
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	p = tuple(map(int, input().rstrip().split()))
	flag = 0
	if n == 1:
		print(-1)
	else:
		m = max(p)
		for i in range(n):
			if p[i] == m:
				if i == 0:
					if p[1] < m:
						print(1)
						flag = 1
						break
				elif i == n - 1:
					if p[n - 2] < m:
						print(n)
						flag = 1
						break
				elif p[i - 1] < m or p[i + 1] < m:
					print(i + 1)
					flag = 1
					break
	if flag == 0:
		print(-1)


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	same = [a[0]] * n
	if a == same:
		print(-1)
	else:
		large = -1
		index = 0
		for i in range(n):
			if large < a[i]:
				large = a[i]
				index = i + 1
		j = 0
		if index - 1 == 0:
			while True:
				if a[j] == large:
					while a[j] == large:
						index = j
						j += 1
					break
				j += 1
			index = j
		print(index)


import sys, io, os, time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline
for ii in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	ind = [i for i in range(n) if a[i] == m]
	f = 0
	for i in ind:
		if i - 1 >= 0 and a[i - 1] < m or (i + 1 < n and a[i + 1] < m):
			ans = i + 1
			f = 1
	if f:
		print(ans)
	else:
		print(-1)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from heapq import *
from math import gcd, factorial, floor, ceil
from copy import deepcopy
from collections import deque
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 10 ** 9 + 7

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
inf = pow(10, 20)

def solve(case):
	n = int(inp())
	a = lis()
	mx = max(a)
	for i in range(n):
		if a[i] == mx:
			if i - 1 >= 0 and a[i - 1] != mx:
				print(i + 1)
				return
			elif i + 1 < n and a[i + 1] != mx:
				print(i + 1)
				return
	print(-1)
testcase(int(inp()))


t = input()
t = int(t)
for tt in range(t):
	n = input()
	n = int(n)
	arr = list()
	k = input()
	arr = k.split()
	for i in range(n):
		arr[i] = int(arr[i])
	maxm = max(arr)
	ans = -1
	for i in range(n):
		if arr[i] == maxm:
			if i - 1 >= 0:
				if arr[i - 1] != maxm:
					ans = i + 1
			if i + 1 < n:
				if arr[i + 1] != maxm:
					ans = i + 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	v = max(l)
	noa = -1
	ll = len(list(set(l)))
	if ll == 1:
		print(noa)
	else:
		res = 0
		for i in range(n):
			if l[i] == v:
				if i == 0 and i < 1 and (l[i + 1] != l[i]):
					res = i + 1
					print(res)
					xx = list()
					xx.append(i)
					break
				elif i == n - 1 and l[n - 1] != l[n - 2]:
					res = n
					print(res)
					break
				elif i > 0 and i < n - 1 and (2 < 3):
					vu = len(l)
					if l[i] != l[i + 1] or l[i] != l[i - 1]:
						print(i + 1)
						break


for __ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	kek = []
	lol = max(ar)
	for i in range(n):
		if ar[i] == lol:
			kek.append(i)
	ans = -1
	for elem in kek:
		i = elem - 1
		j = i + 2
		flag = elem + 1
		num = lol
		while i >= 0 or j < n:
			if i >= 0 and ar[i] < num:
				num += 1
				i -= 1
			elif j < n and ar[j] < num:
				j += 1
				num += 1
			else:
				flag = -1
				break
		if flag != -1:
			ans = flag
			break
	print(ans)


for i in range(int(input())):
	n = int(input())
	x = list(map(int, input().split()))
	if len(set(x)) == 1:
		print(-1)
	else:
		c = max(x)
		if x[0] == c and x[1] != c:
			print(1)
			continue
		elif x[-1] == c and x[-2] != c:
			print(n)
			continue
		for i in range(1, n - 1):
			if x[i] == c:
				if x[i - 1] != c or x[i + 1] != c:
					print(i + 1)
					break


for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	if len(set(ar)) == 1:
		print('-1')
	else:
		m = max(ar)
		for i in range(len(ar)):
			if ar[i] == m:
				if i < len(ar) - 1:
					if ar[i + 1] < m:
						print(i + 1)
						break
				if i > 0:
					if ar[i - 1] < m:
						print(i + 1)
						break


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	maximum = max(arr)
	for i in range(n):
		if arr[i] != maximum:
			break
	else:
		print(-1)
		continue
	for i in range(n):
		if arr[i] == maximum:
			if i > 0 and i < n - 1:
				if arr[i] > arr[i - 1] or arr[i] > arr[i + 1]:
					print(i + 1)
					break
			if i == 0:
				if arr[i] > arr[i + 1]:
					print(i + 1)
					break
			if i == n - 1:
				if arr[i] > arr[i - 1]:
					print(i + 1)
					break
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	lst = [int(x) for x in input().split()]
	m = max(lst)
	k = lst.index(m)
	if k:
		print(k + 1)
	else:
		for i in range(1, n):
			if lst[i] != m:
				print(k + 1)
				break
			k = i
		else:
			print(-1)


import sys as _sys

def main():
	t = int(input())
	for i_t in range(t):
		(n,) = _read_ints()
		a = tuple(_read_ints())
		assert len(a) >= 1
		if len(a) == 1:
			result = 1
		elif len(set(a)) == 1:
			result = -1
		else:
			max_a = max(a)
			i = a.index(max_a)
			if i == 0 and a[i + 1] == max_a:
				while a[i + 1] == max_a:
					i += 1
			result = i + 1
		print(result)

def _read_line():
	result = _sys.stdin.readline()
	assert result[-1] == '\n'
	return result[:-1]

def _read_ints():
	return map(int, _read_line().split())
main()


import sys
t = int(input())
for tc in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	mx = index = 0
	if a.count(a[0]) == n:
		print(-1)
		continue
	for i in range(n):
		if a[i] > mx:
			mx = a[i]
			index = i + 1
		if i != 0 and i != n - 1:
			if a[i] == mx and (a[i] > a[i - 1] or a[i] > a[i + 1]):
				index = i + 1
	print(index)


def helper(arr):
	m = max(arr)
	for i in range(len(arr)):
		if arr[i] == m:
			if i == 0 and arr[i + 1] < m:
				return i + 1
			elif i == len(arr) - 1 and arr[i - 1] < m:
				return i + 1
			elif 0 < i < len(arr) - 1 and arr[i - 1] < m:
				return i + 1
			elif 0 < i < len(arr) - 1 and arr[i + 1] < m:
				return i + 1
	return -1
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if a.count(a[0]) == n:
		print(-1)
	else:
		ans = helper(a)
		print(ans)


for _ in range(int(input())):
	n = int(input())
	list_s = list(map(int, input().split()))
	if len(set(list_s)) == 1:
		print(-1)
		continue
	maxEle = max(list_s)
	switch = 0
	for i in range(n - 1):
		if list_s[i] == maxEle and list_s[i + 1] < maxEle:
			print(i + 1)
			switch = 1
			break
	if switch == 0:
		for i in range(1, n):
			if list_s[i] == maxEle and list_s[i - 1] < maxEle:
				print(i + 1)
				break


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	l = list(map(int, input().split()))
	max1 = max(l)
	min1 = min(l)
	if max1 == min1:
		print(-1)
	else:
		for i in range(n):
			if l[i] == max1:
				if i + 1 < n and l[i + 1] < max1:
					ans = i
					break
				if i - 1 >= 0 and l[i - 1] < max1:
					ans = i
					break
		print(ans + 1)


import os
import sys
from math import *
from collections import *
from fractions import *
from heapq import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz/'
M = 1000000007
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	n = Int()
	a = array()
	if len(set(a)) == 1:
		print(-1)
	else:
		key = max(a)
		ans = 1
		for i in range(n):
			if a[i] == key:
				if i > 0 and a[i - 1] != key:
					ans = i + 1
				if i < n - 1 and a[i + 1] != key:
					ans = i + 1
		print(ans)


import collections
for t in range(int(input())):
	n = int(input())
	nums = list(map(int, input().split()))
	if len(set(nums)) == 1:
		print(-1)
		continue
	val = max(nums)
	out = 0
	for i in range(n):
		if nums[i] == val:
			if i > 0 and nums[i - 1] < val:
				out = i
				break
			if i < n - 1 and nums[i + 1] < val:
				out = i
				break
	print(out + 1)


caseNum = int(input())
for i in range(caseNum):
	length = int(input())
	vector = list(map(int, input().split()))
	max_num = max(vector)
	n1 = True
	maxs = []
	for j in range(length):
		if vector[j] == max_num:
			maxs.append(j)
		if vector[j] < max_num:
			n1 = False
	if n1 == True:
		print(-1)
	else:
		for k in maxs:
			if k - 1 >= 0 and vector[k - 1] < max_num or (k + 1 < length and vector[k + 1] < max_num):
				print(k + 1)
				break


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	r = 1
	for i in range(n - 1):
		if a[i] != a[i + 1]:
			r = 0
	if r == 1:
		print(-1)
	else:
		maxx = max(a)
		ind = 0
		for i in range(n):
			if i == 0:
				if a[i] > a[i + 1] and a[i] == maxx:
					print(i + 1)
					break
			elif i == n - 1:
				if a[i] > a[i - 1] and a[i] == maxx:
					print(i + 1)
					break
			elif (a[i] > a[i - 1] or a[i] > a[i + 1]) and a[i] == maxx:
				print(i + 1)
				break


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	(mx, mn) = (max(arr), min(arr))
	if mx == mn:
		print(-1)
		continue
	for i in range(n):
		if arr[i] == mx:
			if i == 0:
				if arr[i + 1] < arr[i]:
					ans = i
			elif i == n - 1:
				if arr[i - 1] < arr[i]:
					ans = i
			elif arr[i - 1] < arr[i] or arr[i + 1] < arr[i]:
				ans = i
	print(ans + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	key = 1
	for i in range(n - 1):
		if l[i] != l[i + 1]:
			key = 0
			break
	if key == 1:
		print(-1)
	else:
		k = max(l)
		for i in range(n):
			if l[i] == k:
				if i < n - 1 and i > 0:
					if l[i + 1] < k or l[i - 1] < k:
						print(i + 1)
						break
				elif i == n - 1:
					if l[i - 1] < k:
						print(i + 1)
						break
				elif l[i + 1] < k:
					print(i + 1)
					break
			else:
				pass


T = int(input())
for i in range(T):
	N = int(input())
	l = list(map(int, input().split()))
	maxi = max(l)
	r = set(l)
	x = 0
	if N == 1 or len(r) == 1:
		x = -1
	for j in range(N):
		if l[j] == maxi:
			if j - 1 >= 0:
				if l[j - 1] != maxi:
					x = j + 1
					break
			if j + 1 < N:
				if l[j + 1] != maxi:
					x = j + 1
					break
	print(x)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	idx_ = -1
	max_ = 0
	arr = [1000000001] + arr + [1000000001]
	for i in range(1, n + 1):
		flag = arr[i] > arr[i - 1] or arr[i] > arr[i + 1]
		if arr[i] >= max_ and flag:
			max_ = arr[i]
			idx_ = i
	print(idx_)


import sys
inp = sys.stdin.buffer.readline
inar = lambda : list(map(int, inp().split()))
inin = lambda : int(inp())
inst = lambda : inp().decode().strip()
wrt = sys.stdout.write
pr = lambda *args, end='\n': wrt(' '.join([str(x) for x in args]) + end)
enum = enumerate
inf = float('inf')
cdiv = lambda x, y: -(-x // y)
mod = 1000000007
_T_ = inin()
for _t_ in range(_T_):
	n = inin()
	a = inar()
	mx = max(a)
	a = [inf] + a + [inf]
	ans = -1
	for i in range(n + 1):
		if a[i] == mx and (a[i - 1] < mx or a[i + 1] < mx):
			ans = i
			break
	print(ans)


for _ in range(int(input())):
	N = int(input())
	A = [int(i) for i in input().split(' ')]
	B = A[::-1]
	Hai = False
	index = 0
	max = A[0]
	for i in range(1, N):
		if A[i] != A[i - 1] and (not Hai):
			Hai = True
		if A[i] > max:
			max = A[i]
			index = i
	if Hai:
		if index != 0:
			print(index + 1)
		else:
			for j in range(1, N):
				if A[j] != max:
					index = j - 1
					break
			print(index + 1)
	else:
		print(-1)


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	dom = False
	for i in range(1, n):
		if a[i] != a[0]:
			dom = True
			break
	if not dom:
		print(-1)
	else:
		siz = 0
		idx = -1
		for i in range(1, n - 1):
			if a[i] > min(a[i - 1], a[i + 1]):
				if a[i] > siz:
					siz = a[i]
					idx = i
		if a[0] > a[1] and a[0] > siz:
			idx = 0
			siz = a[0]
		if a[n - 1] > a[n - 2] and a[n - 1] > siz:
			idx = n - 1
		print(idx + 1)
for _ in range(int(input())):
	solve()


for _ in range(int(input())):
	n = int(input())
	arr = [int(i) for i in input().split()]
	ans = -1
	t = max(arr)
	for i in range(n):
		if i > 0 and arr[i] > arr[i - 1] or (i < n - 1 and arr[i] > arr[i + 1]):
			if arr[i] == t:
				ans = i + 1
				break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	z = max(a)
	out = -1
	for i in range(n):
		if a[i] == z:
			if i < n - 1 and a[i + 1] < z:
				out = i + 1
				break
			if i > 0 and a[i - 1] < z:
				out = i + 1
				break
	print(out)


t = int(input())
for i in range(t):
	n = int(input())
	p = list(map(int, input().split()))
	m = max(p)
	p = [m] + p + [m]
	mi = -1
	for j in range(1, n + 1):
		if p[j] == m and (p[j - 1] < m or p[j + 1] < m):
			mi = j
	print(mi)


n = int(input())
for i in range(n):
	flag = 0
	k = int(input())
	al = list(map(int, input().split()))
	p = max(al)
	ans = []
	for i in range(len(al)):
		if al[i] == p:
			ans.append(i)
	for i in ans:
		if i == 0:
			if al[1] < al[0]:
				print(1)
				flag = 1
				break
		elif i == len(al) - 1:
			if al[i] > al[i - 1]:
				print(len(al))
				flag = 1
				break
		elif al[i] > al[i - 1] or al[i] > al[i + 1]:
			print(i + 1)
			flag = 1
			break
	if flag == 0:
		print(-1)


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if max(a) == min(a):
		ans.append(-1)
	else:
		s = 0
		m = max(a)
		now = a[0] == m
		for j in range(len(a)):
			if (a[j] == m) != now:
				if a[j] == m:
					ans.append(j + 1)
				else:
					ans.append(j)
				break
for x in ans:
	print(x)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	r = max(a)
	f = True
	if a[0] == r and a[1] < r:
		print(1)
		continue
	elif a[-1] == r and a[-2] < r:
		print(n)
		continue
	for i in range(1, n - 1):
		if a[i] == r and (a[i - 1] < r or a[i + 1] < r):
			print(i + 1)
			f = False
			break
	if f:
		print(-1)


T = int(input())
for I in range(0, T):
	N = int(input())
	X = list(map(int, input().split(' ')))
	Y = max(X)
	C = True
	for (A, B) in enumerate(X):
		if B == Y:
			if A == 0 and A == len(X) - 1:
				print(A + 1)
				C = False
				break
			elif A == 0 and A != len(X) - 1:
				if B != X[A + 1]:
					print(A + 1)
					C = False
					break
			elif A != 0 and A == len(X) - 1:
				if B != X[A - 1]:
					print(A + 1)
					C = False
					break
			elif B != X[A + 1] or B != X[A - 1]:
				print(A + 1)
				C = False
				break
	if C:
		print(-1)


import sys
import math
from collections import Counter
from collections import OrderedDict
from functools import reduce
sys.setrecursionlimit(10 ** 6)

def inputt():
	return sys.stdin.readline().strip()

def printt(n):
	sys.stdout.write(str(n) + '\n')

def listt():
	return [int(i) for i in inputt().split()]

def gcd(a, b):
	return math.gcd(a, b)

def lcm(a, b):
	return a * b // gcd(a, b)

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
t = int(inputt())
for _ in range(t):
	n = int(inputt())
	s = listt()
	count = 0
	d = Counter(s)
	maxi = max(d)
	if len(d) == 1:
		print(-1)
	else:
		for i in range(n):
			if s[i] == maxi:
				if i != 0 and s[i - 1] < s[i]:
					print(i + 1)
					break
				elif i != n - 1 and s[i + 1] < s[i]:
					print(i + 1)
					break


from pprint import pprint

def do():
	n = int(input())
	dat = list(map(int, input().split()))
	ma = max(dat)
	res = -1
	for i in range(n):
		if dat[i] != ma:
			continue
		if i != 0:
			if ma > dat[i - 1]:
				res = i + 1
				break
		if i != n - 1:
			if ma > dat[i + 1]:
				res = i + 1
				break
	print(res)
q = int(input())
for _ in range(q):
	do()


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
	else:
		b = []
		for i in range(len(a) - 1):
			if a[i] > a[i + 1]:
				b.append([a[i], i])
		for i in range(1, len(a)):
			if a[i] > a[i - 1]:
				b.append([a[i], i])
		m = -10 ** 18
		j = 0
		for i in b:
			if i[0] > m:
				m = i[0]
				j = i[1] + 1
		print(j)


test_cases = int(input())
for i in range(test_cases):
	num = int(input())
	lst = list(map(int, input().split()))
	maxim = max(lst)
	if lst[1:] == lst[:-1]:
		print('-1')
	else:
		for i in range(1, num):
			if lst[0] == maxim and lst[0] > lst[1]:
				dominant = 1
				break
			elif lst[num - 1] == maxim and lst[num - 2] < lst[num - 1]:
				dominant = num
				break
			elif lst[i - 1] < lst[i] and lst[i] == maxim or (lst[i + 1] < lst[i] and lst[i] == maxim):
				dominant = i + 1
				break
		print(dominant)


R = lambda : map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	arr = list(R())
	if len(set(arr)) == 1:
		print(-1)
	else:
		max_val = max(arr)
		for i in range(n):
			f = 0
			if i and arr[i - 1] < arr[i]:
				f = 1
			if i + 1 < n and arr[i + 1] < arr[i]:
				f = 1
			if f and arr[i] == max_val:
				print(i + 1)
				break


def read_int():
	return int(input())

def solve(s):
	max_number = max(s)
	for i in range(0, n):
		if s[i] == max_number:
			for x in [i - 1, i + 1]:
				if 0 <= x < n and s[i] != s[x]:
					return i + 1
	return -1
t = read_int()
for case in range(t):
	n = read_int()
	s = [int(i) for i in input().split(' ')]
	print(solve(s))


t = int(input())
for tt in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	m = max(a)
	for i in range(n):
		if a[i] == m:
			b.append(i)
	c = -1
	for i in range(len(b)):
		if b[i] == 0:
			if a[1] < m:
				c = 1
				break
		elif b[i] == n - 1:
			if a[n - 2] < m:
				c = n
				break
		elif a[b[i] + 1] < m or a[b[i] - 1] < m:
			c = b[i] + 1
			break
	print(c)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = set(a)
	val = max(a)
	if len(b) == len(a):
		print(a.index(val) + 1)
	elif len(b) == 1:
		print(-1)
	else:
		k = a.index(val)
		l = a.count(val)
		if l == 1:
			print(k + 1)
		elif k == 0:
			while a[k] == val:
				k += 1
			print(k)
		else:
			print(k + 1)


import math
t = int(input())
for tt in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	mm = max(arr)
	flag = False
	for i in range(1, len(arr)):
		if arr[i] == mm:
			if arr[i] > arr[i - 1]:
				print(i + 1)
				flag = True
				break
	if flag:
		continue
	for i in range(len(arr) - 1):
		if arr[i] == mm:
			if arr[i] > arr[i + 1]:
				print(i + 1)
				flag = True
				break
	if not flag:
		print(-1)


def find():
	l = int(input())
	n = list(map(int, input().split()))
	mx = max(n)
	mn = min(n)
	if mx == mn:
		return -1
	else:
		for i in range(len(n)):
			if n[i] == mx:
				if i - 1 >= 0:
					if n[i - 1] < n[i]:
						return i + 1
				if i + 1 < len(n):
					if n[i + 1] < n[i]:
						return i + 1
t = int(input())
while t > 0:
	print(find())
	t -= 1


for s in [*open(0)][2::2]:
	a = (*map(int, s.split()),)
	n = len(a)
	m = max(a)
	i = j = a.index(m)
	while j < n and a[j] == m:
		j += 1
	print(i and i + 1 or (j < n and j) or -1)


out = ''
for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	f = 1
	for i in range(n):
		if a[i] == mx:
			if i - 1 >= 0 and a[i - 1] < a[i] or (i + 1 < n and a[i + 1] < a[i]):
				out += str(i + 1)
				f = 0
				break
	if f:
		out += str(-1)
	out += '\n'
print(out)


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) != 1:
		mm = max(arr)
		for j in range(n - 1):
			if arr[j] == mm and mm != arr[j + 1]:
				print(j + 1)
				break
			elif arr[j] != mm and mm == arr[j + 1]:
				print(j + 2)
				break
	else:
		print(-1)


def solve(lst):
	ans = 0
	mx = 0
	mxIndex = -1
	for x in lst:
		mx = max(mx, x)
	for i in range(0, len(lst) - 1):
		if lst[i] == mx and lst[i] > lst[i + 1]:
			mxIndex = i + 1
		elif lst[i + 1] == mx and lst[i] < lst[i + 1]:
			mxIndex = i + 2
	return mxIndex
t = int(input())
for x in range(t):
	p = int(input())
	lst = list(map(int, input().split(' ')))
	print(solve(lst))


for _ in range(int(input())):
	n = int(input())
	x = list(map(int, input().split()))
	s = len(set(x))
	if s == 1:
		print(-1)
	else:
		m = max(x)
		y = x.index(m)
		for i in range(y, n - 1):
			if x[i] != x[i + 1]:
				y = i
				break
		print(y + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if max(a) == min(a):
		print(-1)
	else:
		a1 = a[:a.index(min(a))]
		a2 = a[a.index(min(a)) + 1:]
		a1.reverse()
		if max(a) in a1:
			ai1 = len(a1) - a1.index(max(a))
		else:
			ai1 = -1
		if max(a) in a2:
			ai2 = len(a1) + 1 + a2.index(max(a)) + 1
		else:
			ai2 = -1
		if ai1 < ai2 and ai1 != -1 or ai2 == -1:
			print(ai1)
		else:
			print(ai2)


def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		m = max(a)
		if a.count(m) == n:
			print(-1)
		for i in range(n):
			if i - 1 >= 0 and a[i - 1] < a[i] and (a[i] == m):
				print(i + 1)
				break
			elif i + 1 < n and a[i + 1] < a[i] and (a[i] == m):
				print(i + 1)
				break
main()


t = int(input())
for i10 in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	p = max(a)
	if sum(a) == n * p:
		print(-1)
	else:
		for i in range(n):
			if (i > 0 and a[i] > a[i - 1] or (i < n - 1 and a[i] > a[i + 1])) and a[i] == p:
				print(i + 1)
				break


t = int(input())
for _ in range(t):
	n = int(input())
	mas = list(map(int, input().split()))
	mx = max(mas)
	fb = 0
	for i in range(n):
		if mas[i] == mx:
			if i - 1 >= 0 and mas[i - 1] < mas[i] or (i + 1 < n and mas[i + 1] < mas[i]):
				print(i + 1)
				fb = 1
				break
	if not fb:
		print(-1)


def problem_sol(x, n):
	maximum = max(x)
	found = False
	if all((i == maximum for i in x)):
		found = True
		print(-1)
	else:
		if x[0] == maximum:
			if x[1] < maximum:
				found = True
				print(1)
		if x[n - 1] == maximum and (not found):
			if x[n - 2] < maximum:
				found = True
				print(n)
		if not found:
			for i in range(1, n - 1):
				if x[i] == maximum:
					if x[i - 1] < maximum or x[i + 1] < maximum:
						found = True
						print(i + 1)
						break
	if not found:
		print(-1)
no_inp = int(input())
while no_inp > 0:
	n = int(input())
	x = list(map(int, input().split()))
	problem_sol(x, n)
	no_inp -= 1


for x in range(int(input())):
	n = int(input())
	m = list(map(int, input().split()))
	k = max(m)
	m.insert(0, k)
	m.append(k)
	if len(set(m)) == 1:
		print(-1)
	else:
		r = 0
		for i in range(1, n + 1):
			if m[i] == k and (m[i - 1] < k or m[i + 1] < k):
				r = 1
				print(i)
				break
		if r == 0:
			print(-1)


import sys
input = sys.stdin.buffer.readline
for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	maxx = max(a)
	ans = -1
	for i in range(n):
		if a[i] == maxx and (i + 1 < n and a[i + 1] < maxx or (i - 1 >= 0 and a[i - 1] < maxx)):
			ans = i + 1
			break
	print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math
from collections import Counter, defaultdict, deque

def int1():
	return int(input())

def map1():
	return map(int, input().split())

def list1():
	return list(map(int, input().split()))
mod = pow(10, 9) + 7

def solve():
	n = int1()
	l1 = list1()
	max1 = max(l1)
	l2 = []
	for i in range(n):
		if l1[i] == max1:
			l2.append(i)
	v = len(l2)
	for i in l2:
		if i == 0:
			if l1[i] > l1[i + 1]:
				print(i + 1)
				return
		elif i == n - 1:
			if l1[i] > l1[i - 1]:
				print(i + 1)
				return
		elif l1[i] > l1[i - 1] or l1[i] > l1[i + 1]:
			print(i + 1)
			return
	print(-1)
for _ in range(int(input())):
	solve()


def pirana(values):
	index = float('-inf')
	maximum = max(values)
	for i in range(0, len(values)):
		if i == 0 and values[i] == maximum and (values[i + 1] < maximum):
			index = i
		if i > 0 and values[i] == maximum and (i < len(values) - 1):
			if values[i - 1] < maximum or maximum > values[i + 1]:
				index = i
		if i == len(values) - 1 and values[i] == maximum and (values[i - 1] < maximum):
			index = i
	if index == float('-inf'):
		return -1
	return index + 1
t = int(input())
for i in range(t):
	n = int(input())
	values = list(map(int, input().split()))
	print(pirana(values))


t = int(input())
for tc in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	mx = 0
	mn = 10 ** 10
	for p in arr:
		mx = max(mx, p)
		mn = min(mn, p)
	if mx == mn:
		mx += 1
	ans = -1
	for i in range(n):
		if arr[i] == mx:
			if i > 0 and arr[i - 1] < mx or (i < n - 1 and arr[i + 1] < mx):
				ans = i + 1
				break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	L = [int(x) for x in input().split()]
	l = []
	ma = -1
	inx = -1
	for i in range(n):
		if L[i] >= ma:
			ma = L[i]
	for i in range(1, n):
		if L[i] == ma and L[i - 1] < L[i]:
			l.append(i + 1)
	for i in range(n - 1):
		if L[i] == ma and L[i] > L[i + 1]:
			l.append(i + 1)
	if len(l) != 0:
		print(l[0])
	else:
		print(-1)


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	MAX = max(A)
	for i in range(n):
		if A[i] == MAX:
			if i > 0 and A[i] > A[i - 1]:
				print(i + 1)
				break
			if i < n - 1 and A[i] > A[i + 1]:
				print(i + 1)
				break
	else:
		print(-1)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	t = max(a)
	if t == min(a):
		print(-1)
	else:
		j = a.index(t) + 1
		if j == 1:
			while j <= n - 1 and a[j] == t:
				j += 1
		print(j)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	m = max(arr)
	val = -1
	for i in range(arr.index(m), n):
		if i - 1 >= 0:
			if arr[i - 1] < m and arr[i] == m:
				val = i + 1
				break
		if i + 1 < n:
			if arr[i + 1] < m and arr[i] == m:
				val = i + 1
				break
	print(val)


for _ in range(int(input())):
	a = int(input())
	ar = list(map(int, input().split()))
	flag = 0
	m = max(ar)
	mi = min(ar)
	if m == mi:
		print(-1)
	else:
		for i in range(1, a - 1):
			if ar[i] == m and (ar[i - 1] < m or ar[i + 1] < m):
				flag = 1
				print(i + 1)
				break
		if flag == 0:
			if m == ar[0]:
				print(1)
			else:
				print(a)


import sys, io, os
BUFSIZE = 8192

class FastIO(io.IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = io.BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(io.IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
T = int(input())
for _ in range(T):
	N = int(input())
	A = list(map(int, input().split()))
	ma = max(A)
	B = [a == ma for a in A]
	if all(B):
		print(-1)
	else:
		ans = B.index(False)
		if ans == 0:
			ans = B.index(True) + 1
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	maxel = 0
	maxindex = -2
	for i in range(n):
		if a[i] > maxel:
			if i > 0 and i < n - 1:
				if a[i] > a[i - 1] or a[i] > a[i + 1]:
					maxel = a[i]
					maxindex = i
			elif i < n - 1:
				if a[i] > a[i + 1]:
					maxel = a[i]
					maxindex = i
			elif a[i] > a[i - 1]:
				maxel = a[i]
				maxindex = i
	print(maxindex + 1)


import sys
input = sys.stdin.readline

def solve(n, fish):
	mx = max(fish)
	nm = n - 1
	for (i, f) in enumerate(fish):
		if f == mx:
			if i > 0 and fish[i - 1] < mx:
				return i + 1
			if i < nm and fish[i + 1] < mx:
				return i + 1
	return -1
t = int(input())
for _ in range(t):
	n = int(input())
	fish = list(map(int, input().split()))
	print(solve(n, fish))


def f(array):
	a = max(array)
	n = len(array)
	for i in range(n):
		if i == 0 and array[i] == a:
			if array[i + 1] != a:
				return i + 1
		elif i == n - 1 and array[i] == a:
			if array[i - 1] != a:
				return i + 1
		elif array[i] == a:
			if array[i - 1] != a:
				return i + 1
			elif array[i + 1] != a:
				return i + 1
	return -1
t = int(input())
for _ in range(t):
	n = int(input())
	piranhas = list(map(int, input().split()))
	out = f(piranhas)
	print(out)


for i in range(int(input())):
	x = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
	else:
		r = max(a)
		ans = -1
		for j in range(x - 1):
			if a[j] == r:
				if a[j + 1] < r:
					ans = j + 1
					break
				if j > 0:
					if a[j - 1] < a[j]:
						ans = j + 1
						break
		if ans == -1:
			ans = x
		print(ans)


t = int(input())
for _ in range(t):
	_ = int(input())
	fish_tank = list(map(int, input().split()))
	max_val = max(fish_tank)
	result = -1
	for i in range(len(fish_tank)):
		if fish_tank[i] == max_val:
			if i > 0 and fish_tank[i - 1] != max_val:
				result = i + 1
			if i < len(fish_tank) - 1 and fish_tank[i + 1] != max_val:
				result = i + 1
	print(result)


t = int(input())
while t:
	n = int(input())
	l = list(map(int, input().split()))
	s = set(l)
	s = list(s)
	if len(s) == 1:
		print(-1)
	else:
		maxi = max(l)
		pp = -1
		p = 0
		for i in range(0, len(l)):
			if l[i] == maxi:
				if i == 0:
					if l[i + 1] < l[i]:
						print(i + 1)
						p = 1
						break
				elif i == n - 1:
					if l[i - 1] < l[i]:
						print(i + 1)
						p = 1
						break
				elif l[i] > l[i - 1] or l[i] > l[i + 1]:
					print(i + 1)
					p = 1
					break
		if p == 0:
			print(-1)
	t -= 1


from math import *
import sys
from sys import stdin
from sys import stdout
input = stdin.readline
for __ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if max(a) == min(a):
		print(-1)
	else:
		m = max(a)
		for i in range(n - 1):
			if a[i] > a[i + 1] and a[i] == m:
				print(i + 1)
				break
			elif a[i] < a[i + 1] and a[i + 1] == m:
				print(i + 2)
				break


from math import *
from bisect import *
from collections import *
from random import *
from decimal import *
from itertools import *
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def st():
	return input().rstrip('\n')

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())
t = inp()
while t:
	t -= 1
	n = inp()
	a = lis()
	z = max(a)
	li = []
	for i in range(n):
		if a[i] == z:
			li.append(i)
	fl = 0
	for i in range(1, len(li) - 1):
		if li[i - 1] + 1 != li[i] or li[i] + 1 != li[i + 1]:
			fl = 1
			re = li[i] + 1
			break
	if min(a) == z:
		print(-1)
	else:
		try:
			if fl:
				print(re)
			elif len(li) == 1:
				print(li[0] + 1)
			else:
				x = li[0]
				y = li[-1]
				if y == n - 1:
					print(x + 1)
				else:
					print(y + 1)
		except:
			if len(li) == 1:
				print(li[0] + 1)
			else:
				x = li[0]
				y = li[-1]
				if y == n - 1:
					print(x + 1)
				else:
					print(y + 1)


for _ in range(int(input())):
	n = int(input())
	list1 = [int(i) for i in input().split()]
	ele = max(list1)
	mini = 0
	for i in range(n):
		if list1[i] == ele:
			if i > 0 and i < n - 1:
				if list1[i] > list1[i + 1] or list1[i] > list1[i - 1]:
					print(i + 1)
					mini = 1
					break
			elif i == 0:
				if list1[i] > list1[i + 1]:
					print(i + 1)
					mini = 1
					break
			elif list1[i] > list1[i - 1]:
				print(i + 1)
				mini = 1
				break
	if mini == 0:
		print(-1)


t = int(input())
for i in range(t):
	n = int(input())
	s1 = list(map(int, input().split()))
	if max(s1) == min(s1):
		print(-1)
	else:
		mx = max(s1)
		it = 0
		for j in range(n):
			if s1[j] == mx and (s1[max(0, j - 1)] < s1[j] or s1[min(n - 1, j + 1)] < s1[j]):
				it = j + 1
		print(it)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def print_list(l):
	print(' '.join(map(str, l)))
for _ in range(N()):
	n = int(input())
	a = RLL()
	if len(set(a)) == 1:
		print(-1)
	else:
		f = False
		res = -1
		m = max(a)
		for i in range(n):
			if a[i] == m:
				if f:
					print(i + 1)
					break
				else:
					res = i + 1
			elif a[i] != m:
				if res > 0:
					print(res)
					break
				else:
					f = True


from math import *
from collections import deque
from copy import deepcopy
import sys

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def multi():
	return map(int, input().split())

def strmulti():
	return map(str, inp().split())

def lis():
	return list(map(int, inp().split()))

def lcm(a, b):
	return a * b // gcd(a, b)

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def stringlis():
	return list(map(str, inp().split()))

def out(var):
	sys.stdout.write(str(var))

def printlist(a):
	print(' '.join((str(a[i]) for i in range(len(a)))))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
t = int(input())
for _ in range(t):
	n = int(input())
	a = lis()
	if len(set(a)) == 1:
		print(-1)
		continue
	else:
		ans = max(a)
		indexy = a.index(ans)
		for i in range(n):
			if i != 0:
				if a[i] == ans and a[i - 1] < ans:
					print(i + 1)
					break
			if i != n - 1:
				if a[i] == ans and a[i + 1] < ans:
					print(i + 1)
					break


def solution():
	n = int(input())
	a = list(map(int, input().split()))
	que = []
	for (i, v) in enumerate(a):
		que.append((v, i + 1))
	que.sort()
	if que[0][0] == que[-1][0]:
		print(-1)
		return
	else:
		maxvalue = que[-1][0]
	for i in range(n):
		if a[i] == maxvalue:
			if i - 1 >= 0 and a[i - 1] < maxvalue:
				print(i + 1)
				return
			if i + 1 < n and a[i + 1] < maxvalue:
				print(i + 1)
				return

def main():
	testcase = int(input())
	for i in range(testcase):
		solution()
	return
main()


test_cases = int(input())
res = []
for i in range(0, test_cases):
	no_of_places = int(input())
	a = list(map(int, input().split(' ')))
	equal = True
	for i in range(0, no_of_places - 1):
		if a[i] != a[i + 1]:
			equal = False
			break
	if equal == True:
		res.append(-1)
	else:
		max = a[0]
		index = 0
		for i in range(1, no_of_places):
			if a[i] > max:
				max = a[i]
		for i in range(1, no_of_places - 1):
			if a[i] == max and (a[i] != a[i - 1] or a[i] != a[i + 1]):
				res.append(i + 1)
				index = i
				break
		if index == 0:
			if a[0] == max and a[0] > a[1]:
				res.append(1)
			elif a[no_of_places - 1] == max and a[no_of_places - 1] > a[no_of_places - 2]:
				res.append(no_of_places)
			else:
				res.append(-1)
for i in res:
	print(i)


def inlt():
	return list(map(int, input().split()))

def find_dominant(Tank):
	largest = max(Tank)
	for i in range(0, len(Tank)):
		if Tank[i] == largest:
			if i == 0:
				if Tank[i + 1] < Tank[i]:
					return i + 1
			elif i == len(Tank) - 1:
				if Tank[i - 1] < Tank[i]:
					return i + 1
			elif Tank[i - 1] < Tank[i] or Tank[i + 1] < Tank[i]:
				return i + 1
	return -1
t = int(input())
for i in range(0, t):
	int(input())
	Tank = inlt()
	print(find_dominant(Tank))


t = int(input())
l = [0, 1]
for i in range(2, 1000):
	l.append(i * i)
while t:
	t -= 1
	n = int(input())
	l = list(map(int, input().split()))
	pos = 0
	if n == 1:
		print(1)
		continue
	maxi = -19900000
	for i in range(0, n):
		if l[i] > maxi:
			if i == 0:
				if l[i] != l[i + 1]:
					pos = i
					maxi = l[i]
			elif i == n - 1:
				if l[i] != l[i - 1]:
					pos = i
					maxi = l[i]
			elif l[i] != l[i - 1] or l[i] != l[i + 1]:
				pos = i
				maxi = l[i]
	if len(set(l)) == 1:
		print(-1)
		continue
	else:
		print(pos + 1)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	maxi = max(a)
	s = 0
	for i in range(len(a)):
		if a[i] < maxi:
			s = 1
			break
	if s == 1:
		f = 0
		if a[0] > a[1] and a[0] == maxi:
			print(1)
			continue
		for j in range(1, len(a) - 1):
			if a[j] == maxi and a[j + 1] < maxi:
				print(j + 1)
				f = 1
				break
			if a[j] == maxi and a[j - 1] < maxi:
				print(j + 1)
				f = 1
				break
		if f == 0:
			if a[n - 1] > a[n - 2]:
				print(n)
	else:
		print(-1)


testCases = int(input())
while testCases > 0:
	n = int(input())
	a = input().split()
	max = -1
	for i in range(n):
		a[i] = int(a[i])
		if a[i] > max:
			max = a[i]
	domPiranhaPos = -2
	for i in range(n):
		if a[i] == max:
			if i > 0 and a[i] > a[i - 1]:
				domPiranhaPos = i
				break
			elif i < n - 1 and a[i] > a[i + 1]:
				domPiranhaPos = i
				break
	print(domPiranhaPos + 1)
	testCases -= 1


def piranha(A):
	M = max(A)
	res = -1
	if len(set(A)) == 1:
		return -1
	n = len(A)
	for i in range(n):
		if A[i] == M and (i < n - 1 and A[i] > A[i + 1] or (i > 0 and A[i] > A[i - 1])):
			res = i + 1
			break
	return res
t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	res = piranha(A)
	print(res)


t = int(input())
for k in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	count = 0
	c = 0
	for i in li:
		if i == li[0]:
			count += 1
	d = max(li)
	flag = False
	for i in range(n):
		if li[i] == d and (not flag):
			if i == 0 and li[i] > li[i + 1]:
				c = i
				flag = True
			elif i == n - 1 and li[i] > li[i - 1]:
				c = i
				flag = True
			elif i > 0 and i < n - 1:
				if li[i] > li[i - 1] or li[i] > li[i + 1]:
					c = i
					flag = True
	if count == n:
		print(-1)
	else:
		print(c + 1)


t = int(input())
for i in range(t):
	n = int(input())
	line = input().strip().split()
	nums = [int(x) for x in line]
	max_ = max(nums)
	min_ = min(nums)
	res = -1
	if max_ != min_:
		for i in range(n):
			if nums[i] == max_:
				if i >= 1 and nums[i] > nums[i - 1] or (i <= n - 2 and nums[i] > nums[i + 1]):
					res = i + 1
					break
	print(res)


import sys
import math

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def getMaxLength(arr, n):
	count = 0
	result = 0
	for i in range(0, n):
		if arr[i] == 0:
			count = 0
		else:
			count += 1
			result = max(result, count)
	return result
for t in range(int(input())):
	n = int(input())
	arr = get_list()
	if len(set(arr)) == 1:
		print(-1)
		continue
	maxim = max(arr)
	pos = []
	for i in range(n):
		if arr[i] == maxim:
			pos.append(i)
	for i in range(len(pos)):
		index = pos[i]
		if index == 0:
			if arr[index + 1] < maxim:
				print(index + 1)
				break
		elif index == n - 1:
			if arr[index - 1] < maxim:
				print(index + 1)
				break
		elif arr[index + 1] < maxim or arr[index - 1] < maxim:
			print(index + 1)
			break


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ma = max(ar)
	if len(set(ar)) == 1:
		print(-1)
	else:
		for i in range(n):
			if ar[i] == ma:
				flag = False
				if i != 0:
					if ar[i - 1] != ma:
						flag = True
				if i != n - 1:
					if ar[i + 1] != ma:
						flag = True
				if flag:
					print(i + 1)
					break


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
from collections import defaultdict
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=300006, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] > k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater

class TrieNode:

	def __init__(self):
		self.children = [None] * 26
		self.isEndOfWord = False

class Trie:

	def __init__(self):
		self.root = self.getNode()

	def getNode(self):
		return TrieNode()

	def _charToIndex(self, ch):
		return ord(ch) - ord('a')

	def insert(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				pCrawl.children[index] = self.getNode()
			pCrawl = pCrawl.children[index]
		pCrawl.isEndOfWord = True

	def search(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				return False
			pCrawl = pCrawl.children[index]
		return pCrawl != None and pCrawl.isEndOfWord

class Node:

	def __init__(self, data):
		self.data = data
		self.count = 0
		self.left = None
		self.right = None

class BinaryTrie:

	def __init__(self):
		self.root = Node(0)

	def insert(self, pre_xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = pre_xor & 1 << i
			if val:
				if not self.temp.right:
					self.temp.right = Node(0)
				self.temp = self.temp.right
				self.temp.count += 1
			if not val:
				if not self.temp.left:
					self.temp.left = Node(0)
				self.temp = self.temp.left
				self.temp.count += 1
		self.temp.data = pre_xor

	def query(self, xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = xor & 1 << i
			if not val:
				if self.temp.left and self.temp.left.count > 0:
					self.temp = self.temp.left
				elif self.temp.right:
					self.temp = self.temp.right
			elif self.temp.right and self.temp.right.count > 0:
				self.temp = self.temp.right
			elif self.temp.left:
				self.temp = self.temp.left
			self.temp.count -= 1
		return xor ^ self.temp.data
for ik in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	ma = max(l)
	for i in range(n):
		if i > 0:
			if l[i] == ma and l[i - 1] < l[i]:
				ind = i + 1
		if i < n - 1:
			if l[i] == ma and l[i + 1] < l[i]:
				ind = i + 1
	l.sort()
	if l[0] != l[-1]:
		print(ind)
	else:
		print(-1)


from collections import defaultdict

def solve(n, a):
	x = max(a)
	for i in range(n):
		if a[i] == x and (i != 0 and a[i - 1] != x or (i != n - 1 and a[i + 1] != x)):
			return i + 1
	return -1
t = int(input())
while t:
	n = int(input())
	a = list(map(int, input().split()))
	print(solve(n, a))
	t -= 1


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	k = max(arr)
	if arr.count(k) != n:
		ans = -1
		for i in range(n - 1):
			if arr[i] == k and arr[i + 1] != k:
				ans = i + 1
				break
			elif arr[i] != k and arr[i + 1] == k:
				ans = i + 2
		print(ans)
	else:
		print('-1')


t = int(input())
for _ in range(t):
	n = int(input())
	fishlist = list(map(int, input().split()))
	check = list(set(fishlist))
	if len(check) == 1:
		print(-1)
	else:
		bigfish = max(fishlist)
		domi = -1
		for i in range(n):
			if i == 0 and fishlist[i] == bigfish:
				if fishlist[i] > fishlist[i + 1]:
					domi = i + 1
					break
			elif i == n - 1 and fishlist[i] == bigfish:
				if fishlist[i] > fishlist[i - 1]:
					domi = i + 1
					break
			elif fishlist[i] == bigfish:
				if fishlist[i] > fishlist[i - 1] or fishlist[i] > fishlist[i + 1]:
					domi = i + 1
					break
		print(domi)


def solve(n, s):
	m = max(s)
	(f, r, x) = (0, 0, 0)
	flag = False
	sarr = sorted(s)
	if s[0] == m and s[1] < m:
		print(1)
	elif s[len(s) - 1] == m and s[len(s) - 2] != m:
		print(len(s))
	else:
		for j in range(1, len(s) - 1):
			if s[j] == m and (s[j - 1] != m or s[j + 1] != m):
				print(j + 1)
				break
		else:
			print(-1)
for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	solve(n, lst)


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	a = input().split()
	for i in range(0, n):
		a[i] = int(a[i])
	b = set(a)
	if len(b) == 1:
		print(-1)
	else:
		k = max(a)
		index = -1
		for i in range(0, n - 1):
			if (a[i] == k) & (a[i + 1] < a[i]):
				index = i
				break
		if index == -1:
			for i in range(1, n):
				if (a[i] == k) & (a[i] > a[i - 1]):
					index = i
					break
		print(index + 1)


n = int(input())
l = list()
ln = list()
for i in range(n):
	ln.append(int(input()))
	l.append(list(map(int, input().rstrip().split())))
for ml in l:
	p = 1
	m = ml[0]
	df = False
	if len(ml) == 1:
		df = True
	result = -1
	for i in ml:
		if not df:
			if i != m:
				df = True
			if i >= m:
				result = p
				m = i
		elif i > m:
			result = p
			m = i
		p += 1
	if df:
		print(result)
	else:
		print(-1)


from collections import *
from functools import *
import math
import sys
inp = sys.stdin.readline
out = sys.stdout.write

def mi():
	return map(int, inp().split())

def li():
	return list(mi())

def ii():
	return int(inp())

def main():
	for _ in range(ii()):
		n = ii()
		a = li()
		m = max(a)
		f = 0
		for i in range(n):
			if a[i] < m:
				f = 1
				break
		if f == 0:
			print(-1)
		else:
			ans = 0
			f = 0
			for i in range(1, n):
				if a[i - 1] != a[i] and a[i] == m:
					ans = i + 1
					f = 1
					break
			if f == 1:
				print(ans)
			else:
				for i in range(n - 1):
					if a[i] != a[i + 1] and a[i] == m:
						ans = i + 1
						f = 1
						break
				print(ans)
main()


testCount = int(input())
indexMatrix = []

def solve(pCount, piranha, offset):
	for i in range(pCount):
		if piranha[i] == offset:
			if i != pCount - 1 and piranha[i] > piranha[i + 1] or (i != 0 and piranha[i] > piranha[i - 1]):
				return i + 1
	return -1
for i in range(testCount):
	pCount = int(input())
	piranha = list(map(int, input().split()))
	max = sorted(piranha, reverse=True)
	indexMatrix.append(solve(pCount, piranha, max[0]))
for i in indexMatrix:
	print(i)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if l.count(max(l)) == n:
		print('-1')
	else:
		i = j = l.index(max(l))
		while i <= n - 2 and l[i] == l[i + 1]:
			i += 1
		if i != n - 1:
			print(i + 1)
		else:
			print(j + 1)


from sys import stdin
t = int(stdin.readline().strip())
for _ in range(t):
	n = int(stdin.readline().strip())
	arr = [int(x) for x in stdin.readline().strip().split(' ')]
	grt = max(arr)
	found = False
	for (idx, val) in enumerate(arr):
		if val == grt:
			if idx - 1 >= 0 and arr[idx - 1] < grt or (idx + 1 <= len(arr) - 1 and arr[idx + 1] < grt):
				print(idx + 1)
				found = True
				break
	if not found:
		print(-1)


def f():
	n = int(input())
	a = list(map(int, input().split()))
	dom = max(a)
	ans = -1
	for j in range(1, n - 1):
		if a[j] == dom and (a[j - 1] != dom or a[j + 1] != dom):
			ans = j + 1
	if a[0] == dom and a[1] != dom:
		ans = 1
	elif a[n - 1] == dom and a[n - 2] != dom:
		ans = n
	print(ans)
t = int(input())
for i in range(t):
	f()


import os
import sys
import math
import collections

def get_int():
	return int(input())

def get_ints():
	return map(int, input().split())

def get_strs():
	return input().split()

def get_float():
	return float(input())

def get_floats():
	return map(float, input().split())

def list_strs():
	return list(input().split())

def list_ints():
	return list(map(int, input().split()))

def list_floats():
	return list(map(float, input.split()))

def post(x):
	print(x, end=' ')
T = int(input())
for t in range(1, T + 1):
	n = get_int()
	a = list_ints()
	if len(set(a)) == 1:
		print(-1)
	else:
		large = max(a)
		flag = True
		for i in range(n):
			if a[i] == large and flag:
				if i == 0:
					if a[i] > a[i + 1]:
						res = i
						flag = False
				elif i == n - 1:
					if a[i] > a[i - 1]:
						res = i
						flag = False
				elif a[i] > a[i - 1] or a[i] > a[i + 1]:
					res = i
					flag = False
		print(res + 1)


def kira(l, n):
	if len(set(l)) == 1:
		return -1
	mx = max(l)
	for i in range(n):
		if l[i] == mx:
			if i != n - 1:
				if l[i + 1] < mx:
					return i + 1
			if i != 0:
				if l[i - 1] < mx:
					return i + 1
	return -1
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	print(kira(l, n))


p = int(input())
while p:
	t = int(input())
	n = t - 1
	j = 0
	max = 0
	a = list(map(int, input().split()))
	for i in range(t):
		if i == 0:
			max = a[0]
		if a[i] != a[i - 1] and i != 0:
			if a[i] > a[i - 1]:
				if a[i] >= max:
					max = a[i]
					j = i
				else:
					True
			elif a[i - 1] >= max:
				max = a[i - 1]
				j = i - 1
			else:
				True
		elif max == a[i] and a[i - 1] == a[i] and (n != 0):
			n -= 1
	if n != 0:
		print(j + 1)
	else:
		print(-1)
	p -= 1


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = ip()
for _ in range(t):
	n = ip()
	arr = list(inp())
	ch = max(arr)
	if arr.count(ch) == n:
		ans = -1
	else:
		for i in range(n):
			if arr[i] == ch:
				if i + 1 < n:
					if arr[i + 1] < arr[i]:
						ans = i + 1
						break
				if i - 1 >= 0:
					if arr[i - 1] < arr[i]:
						ans = i + 1
						break
	out(ans)


t = int(input())
while t:
	t -= 1
	n = input()
	a = [int(i) for i in input().split()]
	mxi = 0
	isd = False
	for i in range(len(a)):
		if a[i] != a[mxi]:
			isd = True
		if a[i] > a[mxi]:
			mxi = i
	if not isd:
		print(-1)
	else:
		if mxi == 0:
			while a[mxi] == a[0]:
				mxi += 1
			mxi -= 1
		print(mxi + 1)


import sys

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math
from collections import defaultdict
for _ in range(ri()):
	n = ri()
	l = ria()
	k = max(l)
	if len(set(l)) == 1:
		wi(-1)
	elif l[0] == k and l[0] != l[1]:
		wi(1)
	elif l[-1] == k and l[-1] != l[-2]:
		wi(n)
	else:
		for i in range(1, n - 1):
			if l[i] == k and (l[i - 1] != k or l[i + 1] != k):
				wi(i + 1)
				break


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time
inf = 10 ** 12
mod = 10 ** 9 + 7

def LI():
	return list(map(int, input().split()))

def II():
	return int(input())

def LS():
	return list(input().split())

def S():
	return input()

def solve():
	n = II()
	a_list = LI()
	if len(set(a_list)) == 1:
		return -1
	a_max = max(a_list)
	for i in range(n):
		if a_list[i] != a_max:
			continue
		if i > 0 and a_list[i - 1] != a_max or (i < n - 1 and a_list[i + 1] != a_max):
			return i + 1

def main():
	t = II()
	res = list()
	for _ in range(t):
		res.append(solve())
	for ans in res:
		print(ans)
	return 0
main()


t = int(input())
for i in range(t):
	N = int(input())
	L = list(map(int, input().split()))
	M = max(L)
	m = min(L)
	if M == m:
		print(-1)
	else:
		L = [M] + L + [M]
		for i in range(1, N + 1):
			if L[i] == M:
				if L[i] > L[i - 1] or L[i] > L[i + 1]:
					print(i)
					break


for u in range(int(input())):
	n = int(input())
	x = [int(w) for w in input().split()]
	if len(set(x)) == 1:
		print(-1)
	else:
		t = max(x)
		if x.count(t) == 1:
			print(1 + x.index(t))
		elif x[0] == t and x[1] < t:
			print(1)
		elif x[-1] == t and x[-2] < t:
			print(n)
		else:
			for i in range(1, n - 1):
				if x[i] == t and (x[i - 1] != t or x[i + 1] != t):
					print(i + 1)
					break


testcases = int(input())
for t in range(testcases):
	poolSize = int(input())
	piranhas = [int(p) for p in input().split()]
	mx = max(piranhas)
	mn = min(piranhas)
	if mx == mn:
		print(-1)
		continue
	dominant = -1
	for pIndex in range(poolSize):
		if mx != piranhas[pIndex]:
			continue
		if pIndex == 0:
			if piranhas[0] > piranhas[1]:
				dominant = 1
				break
		elif pIndex == poolSize - 1:
			if piranhas[poolSize - 2] < piranhas[poolSize - 1]:
				dominant = poolSize
				break
		elif piranhas[pIndex] > piranhas[pIndex + 1] or piranhas[pIndex] > piranhas[pIndex - 1]:
			dominant = pIndex + 1
			break
	print(dominant)


from collections import Counter, defaultdict
I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
for _ in range(I()):
	n = I()
	a = LI()
	b = max(a)
	if a.count(b) == n:
		print(-1)
	else:
		for i in range(0, n):
			if a[i] == b:
				if a[i - 1] != b and i != 0:
					print(i + 1)
					break
				elif i + 1 != n and a[i + 1] != b:
					print(i + 1)
					break


for _ in range(int(input())):
	n = int(input())
	found = 0
	ar = list(map(int, input().split()))
	m = max(ar)
	for i in range(1, n):
		if ar[i - 1] < ar[i] and ar[i] == m:
			print(i + 1)
			found = 1
			break
		elif ar[i - 1] > ar[i] and ar[i - 1] == m:
			print(i)
			found = 1
			break
	if found == 0:
		print(-1)


mod = 10 ** 9 + 7
INF = float('inf')

def readInts():
	return list(map(int, input().split()))

def readTuples():
	return tuple(map(int, input().split()))

def I():
	return int(input())
q = I()
for _ in range(q):
	n = I()
	A = readInts()
	ma = max(A)
	if len(set(A)) == 1:
		print(-1)
		continue
	for i in range(n):
		if ma == A[i]:
			if i - 1 >= 0:
				if A[i - 1] < ma:
					print(i + 1)
					break
			if i + 1 < n:
				if A[i + 1] < ma:
					print(i + 1)
					break


t = int(input())
for i in range(0, t):
	n = int(input())
	lst = list(map(int, input().split()))
	high = max(lst)
	ans = -1
	for j in range(0, n):
		if lst[j] == high:
			if j == 0 and lst[j] > lst[j + 1]:
				ans = j + 1
				break
			elif j == n - 1 and lst[j] > lst[j - 1]:
				ans = j + 1
				break
			elif j != 0 and j != n - 1:
				if lst[j] > lst[j + 1] or lst[j] > lst[j - 1]:
					ans = j + 1
					break
	print(ans)


q = int(input())

def f(p, i):
	if i == 0 and len(p) == 1:
		return False
	if i == 0:
		if p[i] > p[i + 1]:
			return True
		else:
			return False
	if i == len(p) - 1:
		if p[i] > p[i - 1]:
			return True
		else:
			return False
	if p[i] > p[i - 1] or p[i] > p[i + 1]:
		return True
	else:
		return False
	return False
for i in range(0, q):
	n = int(input())
	p = list(map(int, input().split()))
	l = []
	m = p[0]
	mi = 0
	otv = -1
	h = f(p, 0)
	if h:
		otv = 0
	l.append([p[0], 0, h])
	for i in range(1, n):
		if m == p[i]:
			c = f(p, i)
			if c:
				otv = i
			l.append([p[i], i, c])
		elif m < p[i]:
			c = f(p, i)
			if c:
				otv = i
			m = p[i]
			mi = i
			l = [[p[i], i, c]]
	if n == 1:
		print(1)
	elif len(l) == len(p):
		print(-1)
	else:
		print(otv + 1)


for j in range(int(input())):
	n = int(input())
	vals = list(map(int, input().split()))
	maxy = max(vals)
	found = False
	index = -1
	for s in range(n):
		if vals[s] == maxy:
			if s > 0 and vals[s - 1] < maxy:
				found = True
				index = s
			if s < n - 1 and vals[s + 1] < maxy:
				found = True
				index = s
	if found == False:
		print(-1)
	else:
		print(index + 1)


import sys, threading
import math
from collections import defaultdict, Counter
input = sys.stdin.readline

def rl(type):
	return [type(w) for w in input().split()]

def reverse(arr):
	return arr[-1::-1]

def mod(a, m):
	return (a % m + m) % m

def check_prime(n):
	temp = int(math.sqrt(n) + 1)
	for i in range(2, temp):
		if n % i == 0:
			return False
	return True

def create_graph(n):
	graph = {}
	for _ in range(n):
		(x, y) = map(int, input().split())
		graph[x].append(y)
		graph[y].append(x)
	return graph

def main():
	for _ in range(int(input())):
		n = int(input())
		arr = rl(int)
		if arr.count(arr[0]) == len(arr):
			print(-1)
		elif n == 2:
			print(1 if arr[0] > arr[1] else 2)
		else:
			maxi = max(arr)
			prev = 10000000000
			nex = arr[1]
			for i in range(len(arr)):
				if arr[i] == maxi and (arr[i] > prev or arr[i] > nex):
					break
				prev = arr[i]
				nex = arr[i + 2] if i + 2 < len(arr) else 10000000000
			print(i + 1)
sys.setrecursionlimit(10 ** 6)
threading.stack_size(10 ** 8)
t = threading.Thread(target=main)
t.start()
t.join()


from collections import Counter as cnt, defaultdict as dic
iin = lambda : int(input())
lin = lambda : list(map(int, input().rstrip().split()))
TEST_CASES = True

def main():
	n = iin()
	a = lin()
	new = set(a)
	if n == 1:
		print(1)
		return
	if len(new) == 1:
		print(-1)
		return
	if n == 2:
		if a[0] > a[1]:
			print(1)
		elif a[1] > a[0]:
			print(2)
		return
	ans = -1
	mx = max(new)
	for i in range(1, n - 1):
		if a[i] == mx:
			if a[i + 1] < a[i] or a[i - 1] < a[i]:
				print(i + 1)
				return
	if mx == a[0]:
		print(1)
	else:
		print(n)
	return
if not TEST_CASES:
	main()
else:
	[main() for _ in range(int(input()))]


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for j in range(int(input())):
	n = int(input())
	vals = list(map(int, input().split()))
	maxy = max(vals)
	found = False
	index = -1
	for s in range(n):
		if vals[s] == maxy:
			if s > 0 and vals[s - 1] < maxy:
				found = True
				index = s
			if s < n - 1 and vals[s + 1] < maxy:
				found = True
				index = s
	if found == False:
		print(-1)
	else:
		print(index + 1)


rn = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rns = lambda : map(int, input().split())
rs = lambda : input()
yn = lambda x: print('Yes') if x else print('No')
YN = lambda x: print('YES') if x else print('NO')
for _ in range(rn()):
	n = rn()
	l = rl()
	if len(set(l)) == 1:
		print(-1)
	else:
		m = max(l)
		for i in range(n):
			if l[i] == m:
				if i < n - 1 and l[i] > l[i + 1] or (i > 0 and l[i] > l[i - 1]):
					print(i + 1)
					break


import sys, os.path
from collections import *
from heapq import *
from copy import *
import math
mod = 10 ** 9 + 7
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	maxx = max(a)
	if a.count(maxx) == n:
		print(-1)
	else:
		ans = 0
		for i in range(n - 1):
			if a[i] == maxx and a[i + 1] == maxx:
				continue
			elif a[i] == maxx or a[i + 1] == maxx:
				if a[i] == maxx:
					ans = i + 1
					break
				else:
					ans = i + 2
					break
		print(ans)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	lst = list(map(int, sys.stdin.readline().split()))
	maxs = max(lst)
	ans = -1
	for i in range(n):
		if lst[i] == maxs:
			if i == 0 and lst[i + 1] < maxs:
				ans = i + 1
				break
			elif i == n - 1 and lst[i - 1] < maxs:
				ans = i + 1
				break
			elif 0 < i < n - 1 and (lst[i - 1] < maxs or lst[i + 1] < maxs):
				ans = i + 1
				break
	print(ans)


def solve():
	n = int(input())
	a = [int(a) for a in input().split()]
	m = max(a)
	for (i, v) in enumerate(a):
		if v == m and (i > 0 and a[i - 1] < v or (i < n - 1 and a[i + 1] < v)):
			print(i + 1)
			return
	print(-1)
	return
t = input()
for i in range(int(t)):
	solve()


tc = int(input())
while tc > 0:
	n = int(input())
	nums = list(map(int, input().split(' ')))
	mx = max(nums)
	ans = -1
	for i in range(0, len(nums) - 1):
		if mx == nums[i] and mx > nums[i + 1]:
			ans = i + 1
			break
	if ans == -1:
		for i in range(1, len(nums)):
			if mx == nums[i] and mx > nums[i - 1]:
				ans = i + 1
				break
	print(ans)
	tc -= 1


def f():
	input()
	s = list(map(int, input().split()))
	i = s.index(max(s)) + 1
	if i > 1:
		return i
	while i < len(s):
		if s[i - 1] != s[i]:
			return i
		i += 1
	return -1
for i in range(int(input())):
	print(f())


for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	if len(list(set(s))) == 1:
		print(-1)
		continue
	k = max(s)
	ans = -1
	for i in range(n):
		if s[i] == k:
			if i == 0:
				if s[i] > s[i + 1]:
					ans = i + 1
					break
			elif i == n - 1:
				if s[i] > s[i - 1]:
					ans = i + 1
					break
			elif s[i] > s[i + 1] or s[i] > s[i - 1]:
				ans = i + 1
				break
	print(ans)


for _ in range(int(input())):
	c = int(input())
	a = list(map(int, input().split()))
	if a.index(max(a)) != 0:
		print(a.index(max(a)) + 1)
	else:
		for i in range(len(a) - 1):
			if a[i] > a[i + 1]:
				print(i + 1)
				c = 0
				break
		if c != 0:
			print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	flag = 0
	for i in a:
		if i != m:
			flag = 1
			break
	if flag == 0:
		print(-1)
	else:
		for i in range(n):
			if a[i] == m:
				if i > 0 and a[i - 1] != m:
					print(i + 1)
					break
				elif i < n - 1 and a[i + 1] != m:
					print(i + 1)
					break


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	L = list(map(int, input().split()))
	if len(set(L)) == 1:
		print(-1)
		return
	val = max(L)
	for i in range(n):
		if L[i] == val:
			if i - 1 > -1 and L[i - 1] < L[i]:
				print(i + 1)
				break
			if i + 1 < n and L[i] > L[i + 1]:
				print(i + 1)
				break
	else:
		print(-1)
for _ in range(int(input())):
	solve()


def fish(arr):
	if len(set(arr)) == 1:
		return -1
	m = max(arr)
	for i in range(len(arr)):
		if arr[i] == m:
			if i > 0 and arr[i - 1] != m or (i < len(arr) - 1 and arr[i + 1] != m):
				return i + 1
	return -1
import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	arr = [int(a) for a in sys.stdin.readline().split()]
	print(fish(arr))


import os
import sys
from io import BytesIO, IOBase
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def main():
	try:
		for _ in range(inp()):
			n = inp()
			a = inlt()
			if len(set(a)) == 1:
				print('-1')
				continue
			m = max(a)
			if a.count(m) > 1:
				for i in range(1, n):
					if a[i - 1] == m and a[i] < m:
						print(i)
						break
					elif i < n - 1:
						if a[i - 1] < m and a[i] == m:
							print(i + 1)
							break
			else:
				print(a.index(m) + 1)
	except Exception as e:
		print(e)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from collections import deque

def solve(arr, n):
	mx = max(arr)
	ans = -1
	for i in range(n - 1):
		if arr[i] == mx and l[i + 1] < mx:
			ans = i + 1
		elif arr[i + 1] == mx and arr[i] < mx:
			ans = i + 2
	return ans
for tt in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	res = solve(l, n)
	d = deque()
	d.append(res)
	for i in d:
		print(i)


t = int(input())
for _ in range(t):
	n = int(input())
	pirahnas = [int(x) for x in input().split()]
	s = set(pirahnas)
	if len(s) == 1:
		print(-1)
	else:
		biggest = max(pirahnas)
		for (i, p) in enumerate(pirahnas):
			if p == biggest and (i != 0 and p > pirahnas[i - 1] or (i != len(pirahnas) - 1 and p > pirahnas[i + 1])):
				print(i + 1)
				break


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	max = 0
	val = 0
	i = 0
	while i < n:
		if i - 1 < 0:
			if arr[i + 1] < arr[i]:
				if arr[i] > val:
					val = arr[i]
					max = i + 1
		elif i + 1 > n - 1:
			if arr[i - 1] < arr[i]:
				if arr[i] > val:
					val = arr[i]
					max = i + 1
		elif arr[i + 1] < arr[i] or arr[i - 1] < arr[i]:
			if arr[i] > val:
				val = arr[i]
				max = i + 1
		i += 1
	if max == 0:
		print(-1)
	else:
		print(max)


for x in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(set(a))
	if len(b) == 1:
		print(-1)
	else:
		s = max(a)
		t = a[0]
		t1 = a[1]
		if t == t1 == s:
			i = 0
			ans = 0
			while i < n:
				if a[i] != s:
					print(i)
					break
				i += 1
		else:
			print(a.index(s) + 1)


a = int(input())
for k in range(a):
	c = int(input())
	b = list(map(int, input().split()))
	d = max(b)
	e = b.count(d)
	if e == c:
		print(-1)
	else:
		for f in range(c):
			if b[f] == d:
				if f != 0 and f != c - 1:
					if b[f - 1] < b[f]:
						print(f + 1)
						break
					elif b[f + 1] < b[f]:
						print(f + 1)
						break
				elif f == 0 and b[1] < b[0]:
					print(1)
					break
				elif f == c - 1 and b[c - 2] < b[-1]:
					print(c)
					break


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if a.count(a[0]) == n:
		print(-1)
	else:
		i = 0
		m = max(a)
		while i < n:
			am = False
			if a[i] == m:
				if i > 0:
					if a[i] > a[i - 1]:
						am = True
				if i < n - 1:
					if a[i] > a[i + 1]:
						am = True
			if am:
				break
			i += 1
		print(i + 1)


m = int(input())
for j in range(m):
	n = int(input())
	arr = [int(x) for x in input().split()]
	allEq = True
	for i in range(n - 1):
		if arr[i] != arr[i + 1]:
			allEq = False
			break
	if allEq:
		print(-1)
		continue
	mx = max(arr)
	for i in range(n):
		if arr[i] != mx:
			continue
		if i != 0 and arr[i - 1] < arr[i]:
			print(i + 1)
			break
		if i != n - 1 and arr[i + 1] < arr[i]:
			print(i + 1)
			break


import math
t = int(input())
for _ in range(t):
	n = int(input())
	l = [int(x) for x in input().split()]
	a = max(l)
	if l[0] == a:
		flag = 1
		for i in range(n):
			if l[i] != a:
				print(i)
				flag = 0
				break
		if flag == 1:
			print(-1)
	else:
		flag = 1
		for i in range(n):
			if l[i] == a:
				print(i + 1)
				flag = 0
				break
		if flag == 1:
			print(-1)


import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict, deque, Counter
from bisect import *
from math import sqrt, pi, ceil
import math
from itertools import permutations
from copy import deepcopy
from sys import setrecursionlimit

def main():
	for t in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		b = set(a)
		if len(b) == 1:
			print(-1)
		else:
			b = max(a)
			ind = -1
			if a[0] == b and a[1] != b:
				ind = 1
			else:
				for i in range(1, n - 1):
					if a[i] == b and (a[i + 1] != b or a[i - 1] != b):
						ind = i + 1
						break
				if ind == -1 and a[-1] == b and (a[-2] != b):
					ind = n
			print(ind)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
	else:
		m = max(a)
		i = 0
		while i < n:
			if a[i] == m:
				f = 0
				if i != 0:
					f |= a[i] != a[i - 1]
				if i != n - 1:
					f |= a[i] != a[i + 1]
				if f:
					break
			i += 1
		print(i + 1)


t = int(input())
for test_case in range(t):
	n = [int(x) for x in input().split()]
	n = n[0]
	a = [int(y) for y in input().split()]
	res = 0
	maxpir = [a[0], 0]
	maxpirs = []
	for i in range(n):
		if a[i] > maxpir[0]:
			(maxpir[0], maxpir[1]) = (a[i], i)
	for i in range(n):
		if a[i] == maxpir[0]:
			maxpirs.append(i)
	for i in maxpirs:
		if i >= 1:
			if a[i - 1] < maxpir[0]:
				res = i
				break
			elif i <= n - 2:
				if a[i + 1] < maxpir[0]:
					res = i
					break
		elif i <= n - 2:
			if a[i + 1] < maxpir[0]:
				res = i
				break
	else:
		res = -2
	res += 1
	print()
	print(res)
	print()


import os
import sys
from io import BytesIO, IOBase

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def prime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def divisors(n):
	i = 1
	div = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				div.append(i)
			else:
				div.append(i)
				div.append(n // i)
		i = i + 1
	return div

def solve():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		m = max(a)
		ans = 0
		for i in range(n):
			if a[i] == m:
				if i == 0:
					if a[i + 1] < a[i]:
						ans = i + 1
						break
				elif i == n - 1:
					if a[i - 1] < a[i]:
						ans = i + 1
						break
				elif a[i - 1] < a[i] or a[i + 1] < a[i]:
					ans = i + 1
					break
		if ans == 0:
			print(-1)
		else:
			print(ans)

def main():
	solve()
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for T in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	b = max(arr)
	if arr.count(b) == len(arr):
		print(-1)
	elif len(arr) >= 2:
		if arr[0] == b and arr[1] != b:
			print(1)
		elif arr[-1] == b and arr[-2] != b:
			print(len(arr))
		else:
			for i in range(1, len(arr) - 1):
				if arr[i] == b and (arr[i - 1] != b or arr[i + 1] != b):
					res = i + 1
					break
			print(res)
	else:
		print(1)


def find_dominant(fish_size_list):
	biggest_size = max(fish_size_list)
	biggest_fish_amount = fish_size_list.count(biggest_size)
	if biggest_fish_amount == 1:
		return fish_size_list.index(biggest_size) + 1
	if biggest_fish_amount == len(fish_size_list):
		return -1
	for i in range(len(fish_size_list)):
		size = fish_size_list[i]
		if size == biggest_size:
			if i == 0:
				if fish_size_list[i + 1] != biggest_size:
					return i + 1
			elif i == len(fish_size_list) - 1:
				if fish_size_list[i - 1] != biggest_size:
					return i + 1
			elif fish_size_list[i - 1] != biggest_size or fish_size_list[i + 1] != biggest_size:
				return i + 1
test_amount = int(input())
for i in range(test_amount):
	fish_amount = int(input())
	fish_size_list = list(map(int, input().split()))
	print(find_dominant(fish_size_list))


t = int(input())
for i in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	m = 0
	k = 0
	d = 0
	for j in range(n):
		if A[j] > m:
			k = 1
			m = A[j]
			if j > 0 and A[j - 1] != m or (j < n - 1 and A[j + 1] != m):
				d = j + 1
		elif A[j] == m:
			k += 1
			if j > 0 and A[j - 1] != m or (j < n - 1 and A[j + 1] != m):
				d = j + 1
	if n == k:
		print(-1)
	else:
		print(d)


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin, ceil, log2, floor
from bisect import bisect_right, bisect_left, bisect
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)

def sumDigits(no):
	return 0 if no == 0 else int(no % 10) + sumDigits(int(no / 10))
MOD = 1000000007
PMOD = 998244353
N = 10 ** 9 + 7
LOGN = 30
T = 1
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().rstrip().split()))
	if n == 1:
		print(a[0])
		continue
	mx = max(a)
	ix = []
	ans = -1
	for i in range(1, n - 1):
		if a[i] == mx and (a[i] > a[i - 1] or a[i] > a[i + 1]):
			ans = i + 1
			break
	if ans == -1:
		if a[0] == mx and a[1] < mx:
			print(1)
		elif a[-1] == mx and a[-2] < mx:
			print(n)
		else:
			print(-1)
	else:
		print(ans)


for tc in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	mx = max(arr)
	for (index, val) in enumerate(arr):
		if val == mx:
			if index > 0:
				if index < n - 1:
					if arr[index - 1] < val or arr[index + 1] < val:
						print(index + 1)
						break
				elif arr[index - 1] < val:
					print(index + 1)
					break
			elif arr[index + 1] < val:
				print(index + 1)
				break
	else:
		print(-1)


for i in range(int(input())):
	o = 0
	n = int(input())
	l = list(map(int, input().split()))
	if l == [l[0]] * len(l):
		print(-1)
		continue
	else:
		mx = max(l)
		for i in range(1, n - 1):
			if l[i] == mx and (l[i] > l[i - 1] or l[i] > l[i + 1]):
				print(i + 1)
				o = 1
				break
		if o == 1:
			continue
		if l[0] == mx and l[0] > l[1]:
			print(1)
			continue
		if l[-1] == mx and l[-1] > l[-2]:
			print(len(l))
			continue


t = int(input())
for z in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	x = max(a)
	ans = -2
	if a[0] == x and a[0] > a[1]:
		print(1)
	elif a[n - 1] == x and a[n - 1] > a[n - 2]:
		print(n)
	else:
		for i in range(1, n - 1):
			if a[i] == x and (a[i] > a[i - 1] or a[i] > a[i + 1]):
				ans = i
				break
		print(ans + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	if a.count(max(a)) == n:
		print(-1)
		continue
	z = max(a)
	if a[0] == z and a[1] < z:
		print(1)
		continue
	if a[n - 1] == z and a[n - 2] < z:
		print(n)
		continue
	for i in range(1, n - 1):
		if a[i] == z and (a[i] > a[i - 1] or a[i] > a[i + 1]):
			print(i + 1)
			break


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) == 1:
		print('-1')
	else:
		mx = max(a)
		res = 0
		for i in range(0, n):
			can = False
			if a[i] == mx and i - 1 >= 0 and (a[i - 1] < a[i]):
				can = True
			if a[i] == mx and i + 1 < n and (a[i + 1] < a[i]):
				can = True
			if can:
				res = i + 1
				break
		print(res)


t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	m = max(A)
	for (i, a) in enumerate(A):
		if a == m:
			if i - 1 >= 0 and A[i - 1] < A[i]:
				print(i + 1)
				break
			if i + 1 < n and A[i + 1] < A[i]:
				print(i + 1)
				break
	else:
		print(-1)


n = int(input())
for i in range(0, n):
	o = int(input())
	p = input().rstrip().split(' ')
	if len(list(set(p))) == 1:
		print(-1)
	else:
		C = list(p)
		G = -1
		C.sort(key=int, reverse=True)
		A = int(C[0])
		for j in range(0, len(p)):
			if j == 0:
				if int(p[j]) == A and int(p[j + 1]) < int(p[j]):
					G = j
					break
			elif j == len(p) - 1:
				if int(p[j]) == A and int(p[j - 1]) < int(p[j]):
					G = j
					break
			elif int(p[j]) == A and (int(p[j + 1]) < int(p[j]) or int(p[j - 1]) < int(p[j])):
				G = j
				break
		if G == -1:
			print(-1)
		else:
			print(G + 1)


def func(n, arr):
	s = set(arr)
	if len(s) == 1:
		print(-1)
		return
	maxm = max(arr)
	if arr[0] == maxm:
		if arr[1] < maxm:
			print(1)
			return
	for i in range(1, n - 1):
		if arr[i] == maxm:
			temp = arr[i]
			if temp > arr[i - 1]:
				print(i + 1)
				return
			if temp > arr[i + 1]:
				print(i + 1)
				return
	if arr[-1] == maxm:
		print(n)
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	func(n, arr)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	max_size = max(a)
	min_size = min(a)
	if max_size == min_size:
		print(-1)
	else:
		index = a.index(max_size)
		if index == 0:
			for i in range(1, n):
				if a[i] != max_size:
					index = i - 1
					break
		print(index + 1)


import sys
from math import gcd, sqrt, ceil, log2
from collections import defaultdict, Counter, deque
from bisect import bisect_left, bisect_right
import math
import heapq
from itertools import permutations
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def get_sum(bit, i):
	s = 0
	i += 1
	while i > 0:
		s += bit[i]
		i -= i & -i
	return s

def update(bit, n, i, v):
	i += 1
	while i <= n:
		bit[i] += v
		i += i & -i

def modInverse(b, m):
	g = math.gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def primeFactors(n):
	sa = set()
	sa.add(n)
	while n % 2 == 0:
		sa.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			sa.add(i)
			n = n // i
	return sa

def seive(n):
	pri = [True] * (n + 1)
	p = 2
	while p * p <= n:
		if pri[p] == True:
			for i in range(p * p, n + 1, p):
				pri[i] = False
		p += 1
	return pri

def check_prim(n):
	if n < 0:
		return False
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def getZarr(string, z):
	n = len(string)
	(l, r, k) = (0, 0, 0)
	for i in range(1, n):
		if i > r:
			(l, r) = (i, i)
			while r < n and string[r - l] == string[r]:
				r += 1
			z[i] = r - l
			r -= 1
		else:
			k = i - l
			if z[k] < r - i + 1:
				z[i] = z[k]
			else:
				l = i
				while r < n and string[r - l] == string[r]:
					r += 1
				z[i] = r - l
				r -= 1

def search(text, pattern):
	concat = pattern + '$' + text
	l = len(concat)
	z = [0] * l
	getZarr(concat, z)
	ha = []
	for i in range(l):
		if z[i] == len(pattern):
			ha.append(i - len(pattern) - 1)
	return ha

def mergeIntervals(arr):
	arr.sort(key=lambda x: x[0])
	m = []
	s = -10000
	max = -100000
	for i in range(len(arr)):
		a = arr[i]
		if a[0] > max:
			if i != 0:
				m.append([s, max])
			max = a[1]
			s = a[0]
		elif a[1] >= max:
			max = a[1]
	if max != -100000 and [s, max] not in m:
		m.append([s, max])
	return m
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
		continue
	z = max(l)
	ans = -1
	for i in range(n):
		if i - 1 >= 0 and l[i] > l[i - 1] and (l[i] == z):
			ans = i + 1
			break
		if i != n - 1 and l[i] > l[i + 1] and (l[i] == z):
			ans = i + 1
			break
	print(ans)


cases = input()
p = 0
while p < int(cases):
	p += 1
	case = []
	many = input()
	lis = input().split(' ')
	for u in lis:
		case.append(int(u))
	mi = min(case)
	ma = max(case)
	if mi == ma:
		print('-1')
	else:
		for x in range(len(case)):
			if case[x] > case[x + 1] and case[x] == ma:
				print(x + 1)
				break
			elif case[x] < case[x + 1] and case[x + 1] == ma:
				print(x + 2)
				break


t = int(input())
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	if len(a) == a.count(m):
		print(-1)
	else:
		for i in range(len(a)):
			if i > 0:
				if a[i] == m and a[i] > a[i - 1]:
					print(i + 1)
					break
			if i < n:
				if a[i] == m and a[i] > a[i + 1]:
					print(i + 1)
					break


t = int(input())
ll = []
for _ in range(t):
	_ = input()
	ss = input().split()
	ll.append([int(s) for s in ss])
for l in ll:
	m = max(l)
	isEqual = True
	for e in l:
		if e != m:
			isEqual = False
			break
	if isEqual:
		print(-1)
	else:
		for i in range(len(l)):
			if l[i] == m and (i < len(l) - 1 and l[i + 1] != m or (i > 0 and l[0] != m)):
				print(i + 1)
				break


for _ in range(int(input())):
	x = int(input())
	a = list(map(int, input().split()))
	if max(a) == min(a):
		print(-1)
	else:
		ax = a.index(max(a))
		if len(a) > ax + 1:
			if a[ax + 1] < a[ax]:
				print(ax + 1)
			else:
				if ax != 0 and a[ax] not in a[:ax]:
					while a[ax - 1] == a[ax]:
						ax -= 1
				else:
					while a[ax + 1] == a[ax]:
						ax += 1
				print(ax + 1)
		elif a[ax - 1] < a[ax]:
			print(ax + 1)
		elif a[ax - 1] == a[ax]:
			while a[ax - 1] != a[ax]:
				ax -= 1
			print(ax + 1)


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(list(set(l))) == 1:
		print(-1)
	elif max(l) == l[0]:
		if l[0] != l[1]:
			print(1)
		else:
			for i in range(n):
				if l[i] != l[0]:
					print(i)
					break
	else:
		print(l.index(max(l)) + 1)


t = int(input())
while t > 0:
	n = int(input())
	ans = []
	res = 0
	l = [int(x) for x in input().split()]
	flag = 0
	for i in range(1, n):
		if l[i] != l[i - 1]:
			flag = 1
			break
	if flag == 1:
		m = l[0]
		for i in range(1, n):
			if m <= l[i]:
				m = l[i]
		for i in range(n):
			if m == l[i]:
				if i != 0 and i != n - 1:
					if l[i - 1] != m or l[i + 1] != m:
						res = i
						break
				elif i == 0:
					if l[i + 1] != m:
						res = 0
				elif l[i - 1] != m:
					res = i
		print(res + 1)
	else:
		print(-1)
	t -= 1


a = int(input())
for i in range(a):
	fish = int(input())
	arr = list(map(int, input().split(' ')))
	mx = max(arr)
	result = -1
	for j in range(fish):
		if arr[j] != mx:
			continue
		if j > 0 and arr[j - 1] != mx:
			result = j + 1
		if j < fish - 1 and arr[j + 1] != mx:
			result = j + 1
	print(result)


try:
	T = int(input())
	for i in range(T):

		def checkme(A):
			if A[0] == maxi and A[1] != maxi:
				return 1
			elif A[-1] == maxi and A[-2] != maxi:
				return len(A)
			for i in range(1, len(A) - 1):
				if A[i] == maxi and (A[i - 1] < maxi or A[i + 1] < maxi):
					return i + 1
			return -1
		n = int(input())
		A = list(map(int, input().split()))
		maxi = max(A)
		print(checkme(A))
except:
	pass


def main():
	outputs = []
	for __ in range(int(input())):
		n = int(input())
		B = list(map(int, input().split()))
		A = B[:]
		l = 0
		r = 1
		eaten = 0
		maxm_index = 0
		while r < n:
			if A[l] > A[r]:
				A[l] += 1
				r += 1
				eaten += 1
				if A[maxm_index] < A[l]:
					maxm_index = l
			elif A[r] > A[l]:
				A[r] += eaten + 1
				l = r
				r += 1
				if A[maxm_index] < A[l]:
					maxm_index = l
				eaten += 1
			elif B[maxm_index] < A[r]:
				A[r] += eaten + 1
				l = r
				r += 1
				eaten += 1
			else:
				l += 1
				r += 1
		if A[l] > max(B):
			outputs.append(l + 1)
		else:
			outputs.append(-1)
	for output in outputs:
		print(output)
main()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	mx = max(arr)
	for i in range(n):
		if arr[i] == mx:
			if i - 1 >= 0 and arr[i - 1] < mx:
				print(i + 1)
				break
			if i + 1 < n and arr[i + 1] < mx:
				print(i + 1)
				break
	else:
		print(-1)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	flag = 0
	cur = a[0]
	for i in a:
		if i != cur:
			flag = 1
			break
	else:
		print(-1)
	if flag == 1:
		b = a.index(max(a))
		for i in range(b, n - 1):
			if a[i] != a[i + 1]:
				print(i + 1)
				break
		else:
			print(b + 1)


import sys
try:
	import os
	f = open('input.txt', 'r')
	sys.stdin = f
except FileNotFoundError:
	None
from math import sqrt, ceil
input = lambda : sys.stdin.readline().strip()
o = int(input())
for _ in range(o):
	n = int(input())
	A = list(map(int, input().split()))
	x = max(A)
	if A[0] == x and A[1] != x:
		print(1)
		continue
	if A[-1] == x and A[n - 2] != x:
		print(n)
		continue
	for i in range(1, n - 1):
		if A[i] == x and (not (A[i - 1] == x and A[i + 1] == x)):
			print(i + 1)
			break
	else:
		print(-1)


import sys
T = int(sys.stdin.readline())
for _ in range(T):
	n = int(sys.stdin.readline())
	list_num = [1000000000] + list(map(int, sys.stdin.readline().split())) + [1000000000]
	now = -1
	for i in range(1, n + 1):
		if list_num[i] > list_num[i + 1] or list_num[i] > list_num[i - 1]:
			if now == -1:
				now = i
			elif list_num[now] < list_num[i]:
				now = i
	print(now)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	dom = max(a)
	cnt = 0
	for i in range(0, n):
		if a[i] == dom:
			if i == n - 1 and a[i - 1] != dom:
				print(i + 1)
				cnt += 1
				break
			elif i == 0 and a[1] != dom:
				print(i + 1)
				cnt += 1
				break
	if cnt == 0:
		for i in range(1, n - 1):
			if a[i] == dom:
				if a[i + 1] != dom or a[i - 1] != dom:
					print(i + 1)
					cnt += 1
					break
	if cnt == 0:
		print('-1')


for i in range(int(input())):
	n = int(input())
	l = [int(num) for num in input().split()]
	m = l.index(max(l))
	(j, c) = (0, 0)
	M = max(l)
	if m > 0:
		print(m + 1)
	elif l[0] == l[1]:
		for j in range(2, n):
			if l[j] < l[0]:
				print(j)
				c = 1
				break
		if c == 0:
			print(-1)
	else:
		print(1)


t = int(input())
while t != 0:
	n = int(input())
	mas = [int(a) for a in input().split()]
	k = max(mas)
	if mas == [k] * len(mas):
		print(-1)
	else:
		mas = [10 ** 9 + 1] + mas + [10 ** 9 + 1]
		for i in range(len(mas)):
			if mas[i] == k and (mas[i] > mas[i - 1] or mas[i] > mas[i + 1]):
				print(i)
				break
	t = t - 1


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	if len(set(a)) == 1:
		print(-1)
	else:
		m = max(a)
		for i in range(n):
			if a[i] == m and (i > 0 and a[i - 1] < m or (i + 1 < n and a[i + 1] < m)):
				break
		print(i + 1)


from sys import maxsize, stdout, stdin
mod = int(1000000000.0 + 7)

def I():
	return int(stdin.readline())

def lint():
	return [int(x) for x in stdin.readline().split()]

def S():
	return input().strip()

def grid(r, c):
	return [lint() for i in range(r)]
for _ in range(I()):
	n = I()
	ls = lint()
	if len(set(ls)) == 1:
		print(-1)
	else:
		m = -1
		idx = 0
		for i in range(n):
			if i < n - 1:
				if ls[i] > ls[i + 1]:
					if ls[i] > m:
						m = ls[i]
						idx = i
			if i > 0:
				if ls[i] > ls[i - 1]:
					if ls[i] > m:
						m = ls[i]
						idx = i
		print(idx + 1)


for _ in range(int(input())):
	n = int(input())
	r = [int(i) for i in input().split()]
	o = max(r)
	if r.count(o) == len(r):
		print(-1)
		continue
	kq = -1
	for i in range(1, len(r)):
		if r[i] == o and r[i] > r[i - 1]:
			kq = i + 1
	for i in range(len(r) - 1):
		if r[i] == o and r[i] > r[i + 1]:
			kq = i + 1
	print(kq)


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	m = max(arr)
	found = False
	for i in range(n):
		if arr[i] < m:
			found = True
			break
	for i in range(n):
		if arr[i] != m:
			if i + 1 < n and arr[i + 1] == m:
				print(i + 2)
				break
			elif i - 1 >= 0 and arr[i - 1] == m:
				print(i)
				break
	if not found:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	allEqual = True
	temp = arr[0]
	for num in arr:
		if num != temp:
			allEqual = False
	biggest = max(arr)
	ans = 0
	for i in range(1, len(arr) - 1):
		if arr[i] == biggest and (arr[i] != arr[i + 1] or arr[i] != arr[i - 1]):
			ans = i
	if arr[0] == biggest and arr[1] < biggest:
		ans = 0
	if arr[len(arr) - 1] == biggest and arr[len(arr) - 2] < biggest:
		ans = len(arr) - 1
	if allEqual:
		print(-1)
	else:
		print(ans + 1)


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	alst = list(map(int, input().split()))
	if max(alst) == min(alst):
		print(-1)
		return
	max_ = max(alst)
	for (i, a) in enumerate(alst):
		if a != max_:
			continue
		if i == 0:
			if alst[i] > alst[i + 1]:
				print(i + 1)
				return
		elif i == n - 1:
			if alst[i] > alst[i - 1]:
				print(i + 1)
				return
		elif alst[i] > alst[i - 1] or alst[i] > alst[i + 1]:
			print(i + 1)
			return
for _ in range(int(input())):
	main()


def heapify(arr, n, i):
	largest = i
	l = 2 * i + 1
	r = 2 * i + 2
	if l < n and arr[i] < arr[l]:
		largest = l
	if r < n and arr[largest] < arr[r]:
		largest = r
	if largest != i:
		(arr[i], arr[largest]) = (arr[largest], arr[i])
		heapify(arr, n, largest)

def heapSort(arr, length):
	n = length
	for i in range(n // 2 - 1, -1, -1):
		heapify(arr, n, i)
	for i in range(n - 1, 0, -1):
		(arr[i], arr[0]) = (arr[0], arr[i])
		heapify(arr, i, 0)
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	arr = a.copy()
	heapSort(arr, n)
	if arr[0] == arr[n - 1]:
		print(-1)
	elif a[0] == arr[n - 1] and a[0] > a[1]:
		print(1)
	elif a[n - 1] == arr[n - 1] and a[n - 1] > a[n - 2]:
		print(n)
	else:
		for i in range(1, n - 1):
			if a[i] == arr[n - 1] and (a[i] > a[i + 1] or a[i] > a[i - 1]):
				print(i + 1)
				break


t = int(input())
arr = []
for _ in range(t):
	n = int(input())
	arr.append(list(map(int, input().split())))
for nums in arr:
	if [nums[0]] * len(nums) == nums:
		print(-1)
		continue
	j = max(nums)
	for i in range(len(nums)):
		if nums[i] == j and (i + 1 < len(nums) and nums[i + 1] < j or (i - 1 >= 0 and nums[i - 1] < j)):
			print(i + 1)
			break


t = int(input())
while t > 0:
	n = int(input())
	a = [int(i) for i in input().split()]
	if len(set(a)) == 1:
		print(-1)
	else:
		maxi = max(a)
		for i in range(n):
			if i != n - 1 and (a[i] == maxi and a[i + 1] != maxi):
				print(i + 1)
				break
			elif i != 0 and (a[i] == maxi and a[i - 1] != maxi):
				print(i + 1)
				break
	t -= 1


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.append(-1)
	domi = -1
	for i in range(n):
		if i == 0 or i == n - 1:
			if i == 0 and arr[i] > arr[i + 1] and (arr[i] > arr[domi]):
				domi = i
			elif i == n - 1 and arr[i] > arr[i - 1] and (arr[i] > arr[domi]):
				domi = i
		elif (arr[i - 1] < arr[i] or arr[i] > arr[i + 1]) and arr[i] > arr[domi]:
			domi = i
	if domi > -1:
		print(domi + 1)
	else:
		print(domi)


T = int(input())
for _ in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	ans = -1
	for (i, x) in enumerate(a):
		if x == m and (i > 0 and x > a[i - 1] or (i < n - 1 and x > a[i + 1])):
			ans = i + 1
			break
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	l = [int(x) for x in input().split()]
	if len(set(l)) == 1:
		print(-1)
		continue
	m = max(l)
	ind = 0
	for i in range(n):
		if l[i] == m:
			if i > 0 and l[i - 1] != m:
				ind = i
				break
			elif i < n - 1 and l[i + 1] != m:
				ind = i
				break
	print(ind + 1)


t = int(input())
for j in range(t):
	k = int(input())
	a = list(map(int, input().split()))
	m = a[0]
	r = 0
	for i in range(1, k):
		if a[i] >= m and (a[i - 1] < a[i] or (i < k - 1 and a[i + 1] < a[i])):
			m = a[i]
			r = i
	if r > 0 or a[1] < a[0]:
		print(r + 1)
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if max(a) == min(a):
		print(-1)
	else:
		m = max(a)
		for i in range(n):
			if i - 1 >= 0:
				if a[i] == m and a[i - 1] < a[i]:
					print(i + 1)
					break
			if i + 1 < n:
				if a[i] == m and a[i + 1] < a[i]:
					print(i + 1)
					break


t = int(input())
for you in range(t):
	n = int(input())
	l = input().split()
	li = [int(i) for i in l]
	z = max(li)
	if li[0] == z and li[1] < z:
		print(1)
		continue
	if li[-1] == z and li[-2] < z:
		print(n)
		continue
	poss = 0
	for i in li:
		if i != li[0]:
			poss = 1
			break
	if poss == 0:
		print(-1)
		continue
	for i in range(1, n - 1):
		if li[i] == z and (li[i - 1] < z or li[i + 1] < z):
			print(i + 1)
			break


for i in range(int(input())):
	a = int(input())
	b = [int(i) for i in input().strip().split(' ')]
	max_val = max(b)
	count = 0
	prev = -1
	nextt = -1
	for i in range(len(b)):
		if b[i] == max_val:
			count += 1
			if i - 1 >= 0:
				if b[i - 1] != max_val and prev == -1:
					prev = i
			if i + 1 <= len(b) - 1:
				if b[i + 1] != max_val and nextt == -1:
					nextt = i
	if count != len(b):
		if nextt != -1:
			print(nextt + 1)
		else:
			print(prev + 1)
	else:
		print(-1)


for t in range(int(input())):
	n = int(input())
	p = list(map(int, input().split()))
	if len(set(p)) == 1:
		print(-1)
		continue
	m = max(p)
	index = p.index(m)
	if index == 0 and p[1] == p[0]:
		index += 1
		while len(set([p[index - 1], p[index], p[index + 1]])) == 1:
			index += 1
	print(index + 1)


def piranha(a):
	biggest = max(a)
	c = -1
	for i in range(len(a) - 1):
		if a[i] == biggest:
			if i != 0:
				if a[i + 1] < a[i] or a[i - 1] < a[i]:
					c = i + 1
			elif i == 0:
				if a[i + 1] < a[i]:
					c = i + 1
					break
	if a[-1] == biggest:
		if a[-2] < a[-1]:
			c = len(a)
	return c
n = int(input())
for _ in range(n):
	m = int(input())
	a = list(map(int, input().split()))
	print(piranha(a))


test = int(input())
while test > 0:
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	ans = 0
	flag = 0
	if len(set(a)) == 1:
		flag = 1
		print('-1')
	else:
		for i in range(1, n - 1):
			if a[i + 1] != m or a[i - 1] != m:
				if a[i] == m:
					flag = 1
					ans = i + 1
					print(ans)
					break
	if ans == 0 and flag == 0:
		if a[0] == m:
			ans = 1
		elif a[n - 1] == m:
			ans = n
		print(ans)
	test -= 1


t = int(input())
for i in range(t):
	(n, a) = (int(input()), list(map(int, input().split())))
	result = -1
	mx = max(a)
	if len(a) == 1:
		print(1)
	else:
		for j in range(0, n):
			if a[j] == mx:
				if a[min(j + 1, n - 1)] < mx or a[max(0, j - 1)] < mx:
					result = j + 1
					break
		print(result)


from sys import stdin, stdout

def II():
	return int(stdin.readline())

def LI():
	return list(map(int, stdin.readline().split()))

def solve():
	n = II()
	a = LI()
	maxa = max(a)
	imax = [i for i in range(n) if a[i] == maxa]
	ans = -1
	for i in imax:
		if i == 0 and a[1] < maxa:
			ans = i + 1
		elif i == n - 1 and a[n - 2] < maxa:
			ans = i + 1
		elif i > 0 and i < n - 1 and (a[i - 1] < maxa or a[i + 1] < maxa):
			ans = i + 1
		if ans > 0:
			break
	stdout.write(str(ans) + '\n')
t = II()
for _ in range(t):
	solve()


t = int(input())
for t in range(t):
	q = int(input())
	lst = list(map(int, input().split()))
	max1 = max(lst)
	if max1 == min(lst):
		print(-1)
	else:
		for i in range(len(lst)):
			if i == 0:
				if lst[i] == max1:
					if lst[i + 1] < lst[i]:
						print(i + 1)
						break
			elif i == len(lst) - 1:
				if lst[i] == max1:
					if lst[i - 1] < lst[i]:
						print(i + 1)
						break
			elif lst[i] == max1:
				if lst[i - 1] < lst[i] or lst[i + 1] < lst[i]:
					print(i + 1)
					break


def dominant(piranhas):
	maximum = max(piranhas)
	for (index, piranha) in enumerate(piranhas):
		size = piranha
		pointer = 0
		negative = True
		positive = True
		while positive and negative:
			try:
				if positive:
					if size > piranhas[index + 1 + pointer]:
						size += 1
					else:
						positive = False
			except:
				positive = False
			if index - 1 - pointer < 0:
				negative = False
			if negative:
				if size > piranhas[index - 1 - pointer]:
					size += 1
				else:
					negative = False
			pointer += 1
			if size > maximum:
				return index + 1
	else:
		return -1
for x in range(int(input())):
	throw = input()
	piranhas = [*map(int, input().split(' '))]
	print(dominant(piranhas))


from sys import stdin, stdout
t = int(stdin.readline())
for i in range(t):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	maxi = max(arr)
	mini = min(arr)
	if maxi == mini:
		print(-1)
	else:
		for j in range(len(arr)):
			if arr[j] == maxi and (j > 0 and arr[j - 1] < arr[j] or (j < len(arr) - 1 and arr[j + 1] < arr[j])):
				print(j + 1)
				break


import sys
n = int(input())
for i in range(n):
	a = int(input())
	b = list(map(int, input().split()))
	c = set(b)
	if len(set(b)) == 1:
		print(-1)
	else:
		d = max(b)
		for j in range(a):
			if b[j] == d and j == 0 and (b[j] > b[j + 1]):
				print(j + 1)
				break
			elif b[j] == d and j == a - 1 and (b[j] > b[j - 1]):
				print(j + 1)
				break
			elif b[j] == d and (b[j] > b[j + 1] or b[j] > b[j - 1]) and (j != 0) and (j != a - 1):
				print(j + 1)
				break


import math
import sys, bisect
from heapq import *
from itertools import *
from collections import *
sys.setrecursionlimit(10 ** 6)
I = lambda : int(sys.stdin.readline())
neo = lambda : map(int, sys.stdin.readline().split())
Neo = lambda : list(map(int, sys.stdin.readline().split()))
for _ in range(I()):
	n = I()
	A = Neo()
	if len(set(A)) == 1:
		print(-1)
	else:
		t = max(A)
		f = 0
		for i in range(n):
			if A[i] == t:
				if i == 0:
					if A[i] > A[i + 1]:
						f = 1
						print(i + 1)
						break
				elif i == n - 1:
					if A[i] > A[i - 1]:
						f = 1
						print(i + 1)
						break
				elif A[i] > A[i - 1] or A[i] > A[i + 1]:
					f = 1
					print(i + 1)
					break
		if f == 0:
			print(-1)


def modinv(n, p):
	return pow(n, p - 2, p)

def main():
	for case in range(int(input())):
		n = int(input())
		arr = [int(x) for x in input().split()]
		mx = max(arr)
		arr.append(int(10000000000.0))
		temp = [int(10000000000.0)]
		for x in arr:
			temp.append(x)
		ans = -1
		for i in range(1, n + 1):
			if temp[i] == mx and (temp[i] > temp[i - 1] or temp[i] > temp[i + 1]):
				ans = i
				break
		print(ans)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split(' ')))
	if len(set(A)) == 1:
		print(-1)
		continue
	x = max(A)
	y = A.index(x)
	indices = [i for (i, j) in enumerate(A) if j == x]
	res = y
	for i in indices:
		if i == 0:
			if A[i + 1] != x:
				res = i
				break
			else:
				continue
		elif i == n - 1:
			if A[i - 1] != x:
				res = i
				break
			else:
				continue
		elif A[i + 1] != x or A[i - 1] != x:
			res = i
			break
	print(res + 1)


rr = lambda : input().strip()
rri = lambda : int(rr())
rrm = lambda : [int(x) for x in rr().split()]
from sys import stdin, stdout, setrecursionlimit
from math import ceil
from heapq import *

def sol():
	n = rri()
	nums = rrm()
	can = 0
	res = -1
	x = max(nums)
	for (i, v) in enumerate(nums):
		if v == x and (i > 0 and nums[i] > nums[i - 1] or (i < n - 1 and nums[i] > nums[i + 1])):
			res = i + 1
			can = x
			break
	print(res)
	return

def main():
	T = rri()
	for t in range(1, T + 1):
		ans = sol()
main()


import sys
from os import path
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
t = int(input())
for i in range(t):
	n = int(input())
	p = list(map(int, input().split()))
	count = 0
	if max(p) == min(p):
		print(-1)
	else:
		mn = max(p)
		if p[0] == mn and p[0 + 1] < p[0]:
			print(1)
			continue
		elif p[len(p) - 1] == mn and p[len(p) - 2] < p[len(p) - 1]:
			print(len(p))
			continue
		for j in range(1, len(p) - 1):
			if p[j] == mn:
				if p[j] > p[j - 1] or p[j] > p[j + 1]:
					print(j + 1)
					break
		else:
			print(-1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
		continue
	x = max(l)
	f = 0
	for i in range(1, n - 1):
		if l[i] == x and l[i - 1] < x:
			print(i + 1)
			f = 1
			break
		elif l[i] == x and l[i + 1] < x:
			print(i + 1)
			f = 1
			break
	if f == 0 and l[0] == x and (l[1] < x):
		print(1)
	elif f == 0 and l[n - 1] == x and (l[n - 2] < x):
		print(n)
	elif f == 0:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	list1 = [int(x) for x in input().split()]
	if list1.count(list1[0]) == n:
		print(-1)
	else:
		ind = -1
		maxElem = max(list1)
		for i in range(n):
			if list1[i] == maxElem:
				if i > 0:
					if list1[i - 1] < maxElem:
						ind = i
				if i < n - 1:
					if list1[i + 1] < maxElem:
						ind = i
		if ind == -1:
			print(-1)
		else:
			print(ind + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = a[0]
	arm = 1
	f = False
	for i in range(1, n):
		if a[i] != a[i - 1]:
			f = True
		if a[i] >= m:
			if a[i] != a[i - 1]:
				m = a[i]
				arm = i + 1
			elif i < n - 1:
				if a[i] != a[i + 1]:
					m = a[i]
					arm = i + 1
	if f:
		print(arm)
	else:
		print(-1)


def solve(arr, n):
	maxi = max(arr)
	if arr[0] == maxi and arr[0] > arr[1]:
		return 1
	if arr[n - 1] == maxi and arr[n - 1] > arr[n - 2]:
		return n
	for i in range(1, n - 1):
		if arr[i] == maxi:
			if arr[i] > arr[i - 1] or arr[i] > arr[i + 1]:
				return i + 1
	return -1
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(solve(arr, n))


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	if a == [a[0]] * n:
		print(-1)
	else:
		k = max(a)
		for i in range(n):
			if a[i] == k:
				if i + 1 < n:
					if a[i] > a[i + 1]:
						print(i + 1)
						return
				if i - 1 >= 0:
					if a[i] > a[i - 1]:
						print(i + 1)
						return
		print(-1)

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()
main()


t = int(input())
for _ in range(t):
	n = int(input())
	prn = list(map(int, input().split()))
	if len(set(prn)) == 1:
		print(-1)
		continue
	(idx, maixmum) = (0, max(prn))
	for i in range(1, n):
		if prn[i] == prn[i - 1]:
			continue
		elif prn[i] > prn[i - 1]:
			idx = i + 1
		else:
			idx = i
		if prn[idx - 1] == maixmum:
			print(idx)
			break


for z in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	if a.count(a[0]) == n:
		print('-1')
		continue
	ele = max(a)
	index = n
	for i in range(n - 1):
		if ele == a[i] and ele != a[i + 1]:
			index = i + 1
			break
		if ele != a[i] and ele == a[i + 1]:
			index = i + 2
	print(index)


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
import string
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for _ in range(ii()):
	n = ii()
	a = li()
	max_ = a[0]
	pos = 0
	for i in range(1, n - 1):
		if a[i] >= max_ and a[i] > a[i + 1] or (a[i] >= max_ and a[i] > a[i - 1]):
			max_ = a[i]
			pos = i
	if a[-1] > max_:
		print(n)
	elif a[0] == max_ and a[0] == a[1] and (pos == 0):
		print(-1)
	else:
		print(pos + 1)


for _ in range(int(input())):
	aq = int(input())
	arr = list(map(int, input().split()))
	s = set(arr)
	if len(s) == 1:
		print(-1)
	else:
		mx = max(arr)
		for i in range(len(arr)):
			if arr[i] != mx:
				continue
			if arr[i] == mx and i == 0:
				if arr[i + 1] < mx:
					print(i + 1)
					break
			elif arr[i] == mx and i == aq - 1:
				if arr[i - 1] < mx:
					print(i + 1)
					break
			elif arr[i] == mx:
				if arr[i - 1] < mx or arr[i + 1] < mx:
					print(i + 1)
					break


for _ in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split()]
	if len(set(arr)) == 1:
		print(-1)
	else:
		Max = max(arr)
		ok = False
		for i in range(n):
			if arr[i] == Max:
				if i == 0:
					if arr[i + 1] < Max:
						index = i + 1
						ok = True
						break
				elif i == n - 1:
					if arr[i - 1] < Max:
						index = i + 1
						ok = True
						break
				elif arr[i - 1] < Max or arr[i + 1] < Max:
					index = i + 1
					ok = True
					break
		if ok:
			print(index)
		else:
			print(-1)


from math import gcd
from bisect import bisect_left, bisect_right
from itertools import combinations
from itertools import permutations
from bisect import bisect_left
from math import ceil
from math import radians
from heapq import heapify, heappush, heappop, nsmallest
import bisect
from math import pi
from collections import deque
from math import factorial
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
from fractions import Fraction
mod = int(pow(10, 9) + 7)

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li1():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d:
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d:
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0 and i % 2 == 1:
			s.add(i)
			n = n // i
	if n > 2 and n % 2 == 1:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime

def dijkstra(edges, f, t):
	g = defaultdict(list)
	for (l, r, c) in edges:
		g[l].append((c, r))
	(q, seen, mins) = ([(0, f, ())], set(), {f: 0})
	while q:
		(cost, v1, path) = heappop(q)
		if v1 not in seen:
			seen.add(v1)
			path = (v1, path)
			if v1 == t:
				return (cost, path)
			for (c, v2) in g.get(v1, ()):
				if v2 in seen:
					continue
				prev = mins.get(v2, None)
				next = cost + c
				if prev is None or next < prev:
					mins[v2] = next
					heappush(q, (next, v2, path))
	return float('inf')

def binsearch(a, l, r, x):
	while l <= r:
		mid = l + (r - 1) // 2
		if a[mid]:
			return mid
		elif a[mid] > x:
			l = mid - 1
		else:
			r = mid + 1
	return -1

def readTree(n):
	adj = [set() for _ in range(n)]
	for _ in range(n - 1):
		(u, v) = map(int, input().split())
		adj[u - 1].add(v - 1)
		adj[v - 1].add(u - 1)
	return adj

def treeOrderByDepth(n, adj, root=0):
	parent = [-2] + [-1] * (n - 1)
	ordered = []
	q = deque()
	q.append(root)
	depth = [0] * n
	while q:
		c = q.popleft()
		ordered.append(c)
		for a in adj[c]:
			if parent[a] == -1:
				parent[a] = c
				depth[a] = depth[c] + 1
				q.append(a)
	return (ordered, parent, depth)

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def nextPowerOf2(n):
	count = 0
	if n and (not n & n - 1):
		return n
	while n != 0:
		n >>= 1
		count += 1
	return 1 << count

def cou(n):
	c = 0
	while n > 1:
		c += 1
		n //= 2
	return c

def sortsec(l):
	return sorted(l, key=lambda x: x[1])

def BinarySearch(a, x):
	i = bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def subarray(A):
	r = set()
	p = {0}
	for x in A:
		p = {x | y for y in p} | {x}
		r |= p
	return len(r)

def setBitNumber(n):
	n |= n >> 1
	n |= n >> 2
	n |= n >> 4
	n |= n >> 8
	n |= n >> 16
	n = n + 1
	return n >> 1

def countSetBits(n):
	count = 0
	while n:
		count += n & 1
		n >>= 1
	return count

def allsub(l):
	n = len(l)
	a = []
	for i in range(n - 1):
		for j in range(i + 1, n):
			a.append(l[i:j])
	return a
for _ in range(ii()):
	n = ii()
	l = li1()
	if len(set(l)) == 1:
		print(-1)
		continue
	x = max(l)
	f = 0
	for i in range(1, n - 1):
		if l[i] == x and l[i - 1] < x:
			print(i + 1)
			f = 1
			break
		elif l[i] == x and l[i + 1] < x:
			print(i + 1)
			f = 1
			break
	if f == 0 and l[0] == x and (l[1] < x):
		print(1)
	elif f == 0 and l[n - 1] == x and (l[n - 2] < x):
		print(n)
	elif f == 0:
		print(-1)


def test():
	n = int(input())
	a = list(map(int, input().split()))
	mx = 0
	for s in a:
		if mx < s:
			mx = s
	for i in range(n):
		if i != 0 and a[i] == mx and (a[i - 1] != mx) or (i != n - 1 and a[i] == mx and (a[i + 1] != mx)):
			print(i + 1)
			return
	print(-1)
ttt = int(input())
for i in range(ttt):
	test()


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	x = max(a)
	i = 0
	b = 0
	while i < n:
		if a[i] == x:
			if i == 0:
				if a[i] > a[i + 1]:
					b = 1
					print(i + 1)
					break
			elif i == n - 1:
				if a[i] > a[i - 1]:
					b = 1
					print(i + 1)
					break
			elif a[i] > a[i + 1] or a[i] > a[i - 1]:
				b = 1
				print(i + 1)
				break
		i += 1
	if b == 0:
		print(-1)


t = eval(input())
for j in range(t):
	n = eval(input())
	a = list(map(int, input().split()))
	m = max(a)
	ctr = -1
	for i in range(0, n):
		if a[i] == m and (i > 0 and a[i] > a[i - 1] or (i < n - 1 and a[i] > a[i + 1])):
			ctr = i + 1
	print(ctr)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	best = max(a)
	first = a.index(best)
	if len(set(a)) == 1:
		print(-1)
	else:
		for i in range(first, n):
			if i == 0:
				if a[i] != a[i + 1]:
					print(i + 1)
					break
			elif i == n - 1:
				print(i + 1)
			elif a[i] != a[i - 1] or a[i] != a[i + 1]:
				print(i + 1)
				break


t = int(input())
for tt in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	if mx == min(a):
		print(-1)
	elif a[0] == mx and a[0] > a[1]:
		print(1)
	elif a[-1] == mx and a[-2] < a[-1]:
		print(n)
	else:
		for i in range(1, n - 1):
			if a[i] == mx and (a[i - 1] < a[i] or a[i] > a[i + 1]):
				print(i + 1)
				break


t = int(input())
while t > 0:
	n = int(input())
	a = list(map(int, input().split()))[:n]
	if a.count(a[0]) == n:
		print(-1)
	else:
		m = max(a)
		ind = a.index(m)
		if a.count(m) > 1 and a[0] == m:
			while a[ind + 1] == m:
				ind += 1
		print(ind + 1)
	t = t - 1


for efkjr in range(int(input())):
	a = int(input())
	our = list(map(int, input().split()))
	dom_weight = max(our)
	found = False
	for i in range(a):
		if our[i] == dom_weight:
			if i > 0 and our[i - 1] < our[i]:
				print(i + 1)
				found = True
				break
			if i < a - 1 and our[i] > our[i + 1]:
				print(i + 1)
				found = True
				break
	if not found:
		print(-1)


def find_dominant(fishes):
	maximum = max(fishes)
	length = len(fishes)
	i = 0
	for i in range(length):
		if fishes[i] == maximum:
			if i:
				if i < length - 1 and (fishes[i + 1] < maximum or fishes[i - 1] < maximum):
					return i
				elif i == length - 1 and fishes[i - 1] < maximum:
					return i
			if not i and fishes[i + 1] < maximum:
				return i
	return -1
for test in range(int(input())):
	m = int(input())
	fishes = list(map(int, input().split()))[:m]
	result = find_dominant(fishes)
	print(result + 1 if result >= 0 else result)


from sys import stdout
from sys import stdin

def get():
	return stdin.readline().strip()

def getf():
	return [int(i) for i in get().split()]

def put(a, end='\n'):
	stdout.write(str(a) + end)

def putf(a, sep=' ', end='\n'):
	stdout.write(sep.join([str(i) for i in a]) + end)

def solve(a, n):
	x = 0
	q = []
	for i in range(n):
		if a[i] > a[x]:
			x = i
	for i in range(n):
		if a[i] == a[x]:
			q.append(i)
	for i in q:
		if i > 0:
			if a[i] > a[i - 1]:
				return i + 1
		if i < n - 1:
			if a[i] > a[i + 1]:
				return i + 1
	return -1

def main():
	q = int(get())
	for _ in range(q):
		n = int(get())
		a = getf()
		put(solve(a, n))
main()


tc = int(input())
for case in range(tc):
	input()
	array = list(map(int, input().split(' ')))
	dump = []
	answer = False
	for i in array:
		if i not in dump:
			dump.append(i)
		if len(dump) > 1:
			break
	m = max(array)
	if len(dump) > 1:
		answer = True
		i = 0
		while i < len(array):
			if array[i] == m and i == 0 and (array[i] > array[i + 1]):
				break
			elif array[i] == m and i == len(array) - 1 and (array[i] > array[i] - 1):
				break
			elif array[i] == m and i > 0 and (i < len(array) - 1) and (array[i] > array[i - 1] or array[i] > array[i + 1]):
				break
			i += 1
	if answer:
		print(i + 1)
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	index = []
	for (i, n) in enumerate(a):
		if n == m:
			index.append(i)
	flag = False
	for i in index:
		if i - 1 >= 0 and a[i - 1] < m or (i + 1 < len(a) and a[i + 1] < m):
			flag = True
			ans = i
			break
	if flag:
		print(ans + 1)
	else:
		print(-1)


from sys import stdin, stdout
t = int(stdin.readline())
while t > 0:
	t = t - 1
	n = int(stdin.readline())
	p = list(map(int, stdin.readline().split()))
	mm = p[0]
	idx = 0
	same = True
	for i in range(1, n):
		if p[i] > mm:
			mm = p[i]
			same = False
			idx = i
		elif p[i] < mm:
			same = False
	if same:
		print(-1)
	else:
		found = False
		for i in range(1, n):
			if p[i] != mm and p[i - 1] == mm:
				stdout.write(str(i) + '\n')
				found = True
				break
		if found:
			continue
		for i in range(0, n - 1):
			if p[i] != mm and p[i + 1] == mm:
				stdout.write(str(i + 2) + '\n')
				break


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	if a.count(mx) == 1:
		print(a.index(mx) + 1)
	else:
		l = []
		for i in range(n - 1):
			if a[i] == mx and a[i] == a[i + 1]:
				l.append(i)
		if len(l) == 0:
			print(a.index(mx) + 1)
		elif len(l) == n - 1:
			print(-1)
		else:
			l.insert(n - 1, n - 1)
			mx = 0
			(s, e) = (0, 0)
			ind = -1
			for i in range(len(l)):
				if i == 0:
					if mx < l[i] + 1:
						mx = l[i] + 1
						(s, e) = (0, l[i])
						ind = s + a[s:e + 1].index(max(a[s:e + 1]))
				elif mx < l[i] - l[i - 1] + 1:
					mx = l[i] - l[i - 1] + 1
					(s, e) = (l[i - 1] + 1, l[i])
					ind = s + a[s:e + 1].index(max(a[s:e + 1]))
			print(ind + 1)


t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))[:n]
	b = set(a)
	if len(b) == 1:
		print('-1')
	else:
		c = max(a)
		if a[0] == c and a[1] < c:
			print('1')
		elif a[n - 1] == c and a[n - 2] < c:
			print(n)
		else:
			for i in range(1, len(a) - 1):
				if a[i] == c and a[i + 1] < c:
					print(i + 1)
					break
				elif a[i] == c and a[i - 1] < c:
					print(i + 1)
					break


t = int(input())
for caseNr in range(1, t + 1):
	n = int(input())
	array = list(map(int, input().split()))
	max_ = max(array)
	candidate = None
	for (i, elmt) in enumerate(array):
		if elmt == max_:
			if i != 0 and array[i - 1] < elmt:
				candidate = i
				break
			if i != len(array) - 1 and array[i + 1] < elmt:
				candidate = i
				break
	if candidate == None:
		print(-1)
	else:
		print(candidate + 1)


import math
for _ in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	a = max(A)
	aa = -1
	for i in range(n):
		if a == A[i]:
			if i < n - 1 and A[i + 1] < a:
				aa = i + 1
				break
			if i >= 1 and A[i - 1] < a:
				aa = i + 1
				break
	print(aa)


test = int(input())
for _ in range(test):
	length = int(input())
	a = input().split()
	a = [int(i) for i in a]
	max_value = max(a)
	flag1 = False
	flag2 = False
	for i in range(0, len(a)):
		if a[i] == max_value:
			if i - 1 >= 0:
				if a[i] > a[i - 1]:
					flag1 = True
			if i + 1 <= length - 1:
				if a[i] > a[i + 1]:
					flag2 = True
		if flag1 or flag2:
			print(i + 1)
			break
	if not flag1 and (not flag2):
		print(-1)


for t in range(int(input())):
	ip = int(input())
	lsip = list(map(int, input().split()))
	maxval = max(lsip)
	cmax = lsip.count(maxval)
	if cmax == ip:
		print(-1)
	elif cmax == 1:
		print(lsip.index(maxval) + 1)
	else:
		for i in range(ip):
			if lsip[i] == maxval:
				if i - 1 >= 0 and lsip[i - 1] < maxval:
					print(i + 1)
					break
				elif i + 1 < ip and lsip[i + 1] < maxval:
					print(i + 1)
					break


t = int(input())
for _ in range(0, t):
	n = int(input())
	a = list(map(int, input().split()))
	b = set(a)
	b = list(b)
	if len(b) == 1:
		print(-1)
	else:
		z = max(a)
		pp = -1
		p = 0
		for i in range(0, len(a)):
			if a[i] == z:
				if i == 0:
					if a[i + 1] < a[i]:
						print(i + 1)
						p = 1
						break
				elif i == n - 1:
					if a[i - 1] < a[i]:
						print(i + 1)
						p = 1
						break
				elif a[i] > a[i - 1] or a[i] > a[i + 1]:
					print(i + 1)
					p = 1
					break
		if p == 0:
			print(pp)


n = int(input())
ls = []
for m in range(n):
	kjkhjh = int(input())
	f = list(map(int, input().split()))
	ls.append(f)
for i in ls:
	x = 0
	maxim = max(i)
	for j in range(len(i)):
		if i[j] == maxim:
			if j != 0:
				if i[j] > i[j - 1]:
					print(j + 1)
					x = 1
					break
			if j != len(i) - 1:
				if i[j] > i[j + 1]:
					print(j + 1)
					x = 1
					break
	if x == 0:
		print(-1)


import sys, math, itertools
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))
for _ in range(inp()):
	n = inp()
	a = inpl()
	mx = max(a)
	for (i, x) in enumerate(a):
		res = False
		if x != mx:
			continue
		if i == 0:
			if x > a[i + 1]:
				res = True
		elif i == n - 1:
			if x > a[i - 1]:
				res = True
		elif x > a[i + 1] or x > a[i - 1]:
			res = True
		if res:
			print(i + 1)
			break
	else:
		print(-1)


try:
	for _ in range(int(input())):
		x = int(input())
		a = list(map(int, input().split()))
		b = max(a)
		if x == a.count(b):
			print(-1)
		else:
			for i in range(x):
				if a[i] == b:
					if i == 0 or i == x - 1:
						if i == 0:
							if a[i + 1] != b:
								print(i + 1)
								break
						elif a[i - 1] != b:
							print(i + 1)
							break
					elif a[i + 1] != b or a[i - 1] != b:
						print(i + 1)
						break
except:
	pass


T = int(input())
for _ in range(T):
	n = int(input())
	arr = list(map(int, input().split()))
	ch = arr.copy()
	ch.sort()
	mx = ch[-1]
	if ch.count(mx) == n:
		print(-1)
	else:
		ind = -1
		for i in range(n):
			if arr[i] == mx:
				if i - 1 >= 0:
					if arr[i - 1] < mx:
						ind = i + 1
						break
				if i + 1 < n:
					if arr[i + 1] < mx:
						ind = i + 1
						break
		print(ind)


import sys
t = int(input().strip())
for a0 in range(t):
	n = int(input())
	l1 = [int(i) for i in input().split()]
	count = 1
	l = l1.copy()
	l.sort()
	if l[0] == l[len(l) - 1]:
		print(-1)
	else:
		a = l[len(l) - 1]
		if l1[0] == a and l1[1] != a:
			print(1)
		elif l1[len(l1) - 1] == a and l1[len(l1) - 2] != a:
			print(len(l1))
		else:
			for i in range(1, len(l1) - 1):
				count += 1
				if l1[i] == a and (l1[i - 1] != a or l1[i + 1] != a):
					print(count)
					break


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
for _ in range(ii()):
	n = ii()
	a = il()
	v = -MOD
	for i in range(0, n):
		if a[i] > v:
			if i > 0 and a[i - 1] < a[i]:
				ans = i
				v = a[i]
			elif i < n - 1 and a[i + 1] < a[i]:
				ans = i
				v = a[i]
	if len(set(a)) == 1:
		print(-1)
	else:
		print(ans + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	an = -1
	for j in range(n):
		if a[j] == m:
			if j >= 1 and j <= n - 2:
				if a[j] > a[j - 1] or a[j] > a[j + 1]:
					an = j + 1
					break
			elif j == 0:
				if a[1] < a[0]:
					an = j + 1
					break
			elif a[n - 2] < a[n - 1]:
				an = j + 1
				break
	print(an)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	sss = list(set(arr))
	sss.sort()
	if len(sss) == 1:
		print('-1')
	else:
		vvv = sss[len(sss) - 1]
		ans = -1
		for i in range(n):
			if arr[i] == vvv:
				if i > 0 and arr[i] > arr[i - 1]:
					ans = i + 1
					break
				elif i < n - 1 and arr[i] > arr[i + 1]:
					ans = i + 1
					break
		print(ans)


for z in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	a = max(l)
	b = 0
	for i in range(n):
		if l[i] == a:
			if i - 1 >= 0 and l[i - 1] < l[i]:
				b = i + 1
				break
			elif i + 1 < n and l[i + 1] < l[i]:
				b = i + 1
				break
	if b != 0:
		print(b)
	else:
		print(-1)


def check(i, a):
	left = i - 1
	while left >= 0:
		if a[left] != -1:
			if a[left] < a[i]:
				a[left] = -1
				a[i] += 1
				return True
			else:
				break
		else:
			left -= 1
	right = i + 1
	while right < len(a):
		if a[right] != -1:
			if a[right] < a[i]:
				a[right] = -1
				a[i] += 1
				return True
			else:
				break
		else:
			right += 1
	return False
for _ in range(int(input())):
	input()
	a = [int(i) for i in input().split()]
	max_i = max(a)
	pi = -1
	for k in range(len(a)):
		if a[k] == max_i:
			if k - 1 >= 0 and a[k - 1] < a[k] or (k + 1 < len(a) and a[k + 1] < a[k]):
				pi = k + 1
	print(pi)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	c = 0
	for j in range(n):
		if j - 1 >= 0:
			if a[j] == m:
				if a[j] > a[j - 1]:
					c = c + 1
					break
		if j + 1 <= n - 1:
			if a[j] == m:
				if a[j] > a[j + 1]:
					c = c + 1
					break
	if c == 0:
		print('-1')
	else:
		print(j + 1)


t = int(input())
for case in range(t):
	n = int(input())
	a = [int(x) for x in input().split(' ')]
	if min(a) == max(a):
		ans = -1
	else:
		m = max(a)
		for i in range(n - 1):
			if a[i] != m and a[i + 1] == m:
				ans = i + 2
				break
			elif a[i] == m and a[i + 1] != m:
				ans = i + 1
				break
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	mx = 0
	for j in arr:
		mx = max(mx, j)
	res = cnt = 0
	for var in range(len(arr)):
		if arr[var] == mx:
			cnt = cnt + 1
			if var == 0:
				if arr[var + 1] < arr[var]:
					res = var
					break
			elif var == len(arr) - 1:
				if arr[var - 1] < arr[var]:
					res = var
					break
			elif arr[var - 1] < arr[var] or arr[var + 1] < arr[var]:
				res = var
				break
	if cnt != n:
		print(res + 1)
	else:
		print('-1')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	k = -1
	for j in range(n - 1, 0, -1):
		if a[j] == m and a[j - 1] != m:
			k = j + 1
			break
		elif a[j - 1] == m and a[j] != m:
			k = j
			break
	print(k)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print('-1')
		continue
	z = max(a)
	for i in range(n):
		if a[i] != z:
			continue
		if i > 0 and a[i] != a[i - 1]:
			print(i + 1)
			break
		if i < n - 1 and a[i] != a[i + 1]:
			print(i + 1)
			break


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) < 2:
		print(-1)
		continue
	m = max(arr)
	ind = arr.index(m)
	j = ind + 1
	while j < n and arr[j] == arr[ind]:
		j += 1
	if j == n and arr[j - 1] == arr[ind]:
		j = ind + 1
	print(j)


t = int(input())
for i in range(t):
	n = int(input())
	s = list(map(int, input().split()))
	x = max(s)
	if s[0] != x:
		print(s.index(x) + 1)
	else:
		for j in range(n):
			if s[j] != x:
				print(j)
				break
		else:
			print(-1)


t = int(input())
while t != 0:
	n = int(input())
	a = list(map(int, input().split()))[:n]
	if len(set(a)) == 1:
		print(-1)
		t -= 1
		continue
	i = 0
	j = n - 1
	z = max(a)
	while True:
		if a[i] == z and a[i + 1] < a[i]:
			ans = i + 1
			break
		if a[j] == z and a[j - 1] < a[j]:
			ans = j + 1
			break
		i += 1
		j -= 1
	print(ans)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
	else:
		b = max(a)
		for i in range(len(a)):
			if a[i] == b:
				if i > 0:
					if a[i - 1] < a[i]:
						print(i + 1)
						break
				if i < n:
					if a[i + 1] < a[i]:
						print(i + 1)
						break


from math import *
t = int(input())
for u in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	ind = a.index(mx)
	out = -2
	for i in range(ind, n):
		if i > 0 and a[i] == mx and (a[i - 1] < mx):
			out = i
			break
		if i < n - 1 and a[i] == mx and (a[i + 1] < mx):
			out = i
			break
	print(out + 1)


t = int(input())
for i in range(t):
	ff = 0
	n = int(input())
	a = [int(x) for x in input().split()]
	m = max(*a)
	for j in range(n):
		if a[j] == m:
			if j != n - 1 and j != 0:
				if a[j + 1] < a[j] or a[j - 1] < a[j]:
					print(j + 1)
					ff = 1
					break
			elif j == n - 1:
				if a[j - 1] < a[j]:
					print(j + 1)
					ff = 1
					break
			elif a[j + 1] < a[j]:
				print(j + 1)
				ff = 1
				break
	if ff == 0:
		print(-1)


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])
for _ in range(inp()):
	n = inp()
	x = ip()
	if min(x) == max(x):
		print(-1)
	else:
		mx = max(x)
		for i in range(n):
			if x[i] == mx:
				if i - 1 >= 0 and x[i - 1] < x[i]:
					print(i + 1)
					break
				if i + 1 < n and x[i + 1] < x[i]:
					print(i + 1)
					break


t = int(input())
ans_sp = []

def obrabotka(sp):
	m = max(sp)
	kolvo = sp.count(m)
	if kolvo == 1:
		return sp.index(m) + 1
	if kolvo == len(sp):
		return -1
	for i in range(len(sp)):
		if i == 0 or i == len(sp) - 1:
			if i == 0:
				if sp[i] == m and sp[i + 1] < sp[i]:
					return i + 1
			if i == len(sp) - 1:
				if sp[i] == m and sp[i - 1] < sp[i]:
					return i + 1
		elif sp[i] == m and (sp[i - 1] < sp[i] or sp[i + 1] < sp[i]):
			return i + 1
for i in range(t):
	x = int(input())
	l_x = list(map(int, input().split()))
	ans_sp.append(obrabotka(l_x))
for elem in ans_sp:
	print(elem)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print(-1)
	else:
		ans = -1
		max = 0
		for i in range(n):
			if arr[i] >= max:
				if i != 0 and arr[i - 1] != arr[i] or (i != n - 1 and arr[i + 1] != arr[i]):
					ans = i
					max = arr[i]
		print(ans + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	val_max = 0
	idx_max = 0
	for i in range(n):
		if i == 0:
			if val_max < a[i] and a[i] > a[i + 1]:
				val_max = a[i]
				idx_max = i
		elif i == n - 1:
			if val_max < a[i] and a[i] > a[i - 1]:
				val_max = a[i]
				idx_max = i
		elif val_max < a[i] and (a[i] > a[i - 1] or a[i] > a[i + 1]):
			val_max = a[i]
			idx_max = i
	if val_max == 0:
		print(-1)
	else:
		print(idx_max + 1)


t = int(input())
for i in range(t):
	n = int(input())
	aquarium = list(map(int, input().split()))
	t1 = max(aquarium)
	flag = 0
	for j in range(n):
		if j == 0:
			if t1 == aquarium[j] and n > 1 and (aquarium[j] > aquarium[j + 1]):
				print(j + 1)
				flag = 1
				break
		elif j == n - 1:
			if t1 == aquarium[j] and n > 1 and (aquarium[j] > aquarium[j - 1]):
				print(j + 1)
				flag = 1
				break
		elif aquarium[j] == t1:
			if aquarium[j] > aquarium[j - 1]:
				print(j + 1)
				flag = 1
				break
			elif aquarium[j] > aquarium[j + 1]:
				print(j + 1)
				flag = 1
				break
	if flag == 0:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	lis = list(map(int, input().split()))
	if max(lis) != min(lis):
		idx = lis.index(max(lis))
		i = idx
		while i < n - 1 and lis[i] == lis[i + 1]:
			i += 1
		if i >= n - 1:
			i = idx
			while i > 0 and lis[i] == lis[i - 1]:
				i -= 1
		print(i + 1)
	else:
		print(-1)


t = int(input())

def solve(a, n):
	maxv = max(a)
	for i in range(n):
		if a[i] == maxv:
			if i > 0 and a[i] > a[i - 1]:
				return i + 1
			if i < n - 1 and a[i] > a[i + 1]:
				return i + 1
	return -1
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	print(solve(a, n))


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
	else:
		m = max(l)
		f = 0
		for i in range(n - 1):
			if l[i] == m and l[i + 1] != m:
				f = 1
				print(i + 1)
				break
		if f == 0:
			for i in range(n - 1, 0, -1):
				if l[i] == m and l[i - 1] != m:
					print(i + 1)
					break


T = int(input())

def f(l, n):
	m = max(l)
	s = -1
	ll = list(set(l))
	if len(ll) == 1:
		return -1
	for i in range(n):
		if l[i] == m:
			if i > 0 and l[i - 1] < m:
				return i + 1
			elif i < n - 1 and l[i + 1] < m:
				return i + 1
	return s
while T:
	n = int(input())
	l = [int(k) for k in input().split()]
	print(f(l, n))
	T -= 1


for i in range(int(input())):
	n = int(input())
	nn = [int(s) for s in input().split()]
	r = max(nn)
	if nn.count(r) == 1:
		print(nn.index(r) + 1)
	else:
		kek = -1
		for k in range(n):
			if nn[k] == r:
				if k - 1 >= 0:
					if nn[k - 1] != r:
						kek = k + 1
						break
				if k + 1 < n:
					if nn[k + 1] != r:
						kek = k + 1
						break
		print(kek)


t = int(input())
for q in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	s = max(a)
	w = min(a)
	sid = 0
	wid = 0
	wc = False
	sc = False
	for p in range(n):
		if a[p] == s:
			sid = p
			sc = True
		if a[p] == w:
			wid = p
			wc = True
		if wc and sc:
			break
	if s == w:
		print(-1)
	else:
		ts = sid
		tw = wid
		while ts < tw:
			ts += 1
			if a[ts] == s:
				sid = ts
		while tw < ts:
			tw += 1
			if a[tw] == w:
				wid = tw
		print(sid + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	if a.count(max(a)) == len(a):
		print(-1)
	m = max(a)
	for i in range(n):
		if a[i] == m and (i > 0 and a[i - 1] < a[i] or (i < n - 1 and a[i + 1] < a[i])):
			print(i + 1)
			break


t = int(input())
for _ in range(t):
	n = int(input())
	l = [int(x) for x in input().split()]
	maxi = max(l)
	if l.count(maxi) == n:
		print('-1')
		continue
	ans = -1
	for i in range(1, n - 1):
		if l[i] == maxi:
			if l[i - 1] < maxi or l[i + 1] < maxi:
				ans = i + 1
				break
	if l[n - 1] == maxi and l[n - 2] < maxi:
		ans = n
	if l[0] == maxi and l[1] < maxi:
		ans = 1
	print(ans)


def Maxfish(a, max):
	found = False
	for i in range(0, len(a)):
		if a[i] == max:
			a[i] = 1
		else:
			a[i] = 0
	for i in range(0, len(a)):
		if i == 0 and a[i] == 1 and (i + 1 < len(a) - 1):
			if a[i + 1] == 0:
				if found == False:
					return i + 1
					found = True
		elif i == len(a) - 1 and a[i] == 1:
			if a[i - 1] == 0:
				if found == False:
					return i + 1
					found = True
		elif a[i] == 1:
			if a[i + 1] == 0 or a[i - 1] == 0:
				if found == False:
					return i + 1
					found = True
		if found == True:
			break
	return -1
list = []
n = int(input())
while n > 0:
	size = int(input())
	a = input().split()
	for i in range(0, len(a)):
		a[i] = int(a[i])
	list.append(a)
	a = []
	n = n - 1
for i in range(0, len(list)):
	print(Maxfish(list[i], max(list[i])))


a = int(input())
for k in range(a):
	b = int(input())
	c = [int(i) for i in input().split()]
	m = max(c)
	if m == c[0]:
		for i in range(1, b):
			if c[i] != m:
				print(i)
				break
		else:
			print(-1)
	elif m == c[-1]:
		for i in range(b - 1, -1, -1):
			if c[i] != m:
				print(i + 2)
				break
	else:
		for i in range(b):
			if c[i] == m:
				print(i + 1)
				break


def solve():
	n = int(input())
	lst = list(map(int, input().split()))
	if len(set(lst)) == 1:
		print(-1)
	else:
		mx = max(lst)
		if lst[0] == mx and lst[1] < mx:
			print(1)
			return 0
		for i in range(1, n):
			if lst[i] == mx and (lst[i - 1] < lst[i] or (i != n - 1 and lst[i] > lst[i + 1])):
				print(i + 1)
				return 0
for i in range(int(input())):
	solve()


t = int(input())
while t > 0:
	n = int(input())
	arr = list(map(int, input().split()))
	maxi = max(arr)
	idx = -1
	for i in range(0, n):
		if arr[i] != maxi:
			continue
		if i > 0 and arr[i] > arr[i - 1]:
			idx = i + 1
		if i < n - 1 and arr[i] > arr[i + 1]:
			idx = i + 1
	print(idx)
	t -= 1


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
sys.setrecursionlimit(10 ** 6)
I = sys.stdin.readline

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

def mi():
	return map(int, I().strip().split())

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def valid(row, col, rows, cols, rcross, lcross):
	return rows[row] == 0 and cols[col] == 0 and (rcross[col + row] == 0) and (lcross[col - row] == 0)

def main():
	ans = ''
	for _ in range(ii()):
		n = ii()
		arr = li()
		flag = 1
		for i in range(1, n):
			if arr[i] != arr[i - 1]:
				flag = 0
				break
		if flag:
			ans += '-1\n'
		else:
			maxi = max(arr)
			for i in range(n):
				if arr[i] == maxi:
					if i == 0:
						if arr[i + 1] == maxi:
							continue
						else:
							ans += '1\n'
					elif i == n - 1:
						ans += str(n) + '\n'
					elif arr[i - 1] != maxi or arr[i + 1] != maxi:
						ans += str(i + 1) + '\n'
					else:
						continue
					break
	print(ans)
main()


t = int(input())
for x1 in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	ans = 0
	if len(set(a)) == 1:
		ans = -1
	else:
		k = max(a)
		for x in range(1, n - 1):
			if a[x] == k and (a[x + 1] < k or a[x - 1] < k):
				ans = x + 1
				break
		if ans == 0:
			if a[n - 1] == k and a[n - 2] < k:
				ans = n
			elif a[0] == k and a[1] < k:
				ans = 1
			else:
				ans = -1
	print(ans)


from collections import defaultdict as dd
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	t = max(a)
	if len(set(a)) == 1:
		print(-1)
	else:
		for i in range(n):
			if i > 0:
				if a[i - 1] < a[i] and a[i] == t:
					print(i + 1)
					break
				if a[i - 1] > a[i] and a[i - 1] == t:
					print(i)
					break
			if i < n - 1:
				if a[i] < a[i + 1] and a[i + 1] == t:
					print(i + 2)
					break
				if a[i] > a[i + 1] and a[i] == t:
					print(i + 1)
					break


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	max1 = max(a)
	i = 0
	j = 1
	found = 0
	while j < n:
		if a[i] == a[j]:
			i = i + 1
			j = j + 1
		else:
			found = 1
			break
	if found == 0:
		print(-1)
	else:
		for i in range(n):
			if i == 0:
				if a[i] == max1 and a[i + 1] != max1:
					print(i + 1)
					break
			elif i == n - 1:
				if a[i] == max1 and a[i - 1] != max1:
					print(i + 1)
					break
			elif a[i] == max1 and (a[i - 1] != max1 or a[i + 1] != max1):
				print(i + 1)
				break


from sys import stdin, stdout
import math
import heapq
import collections
input = stdin.readline

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputstrings():
	return [x for x in input().split()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	n = inputnum()
	a = inputlist()
	mx = max(a)
	ind = -1
	for i in range(n):
		if a[i] == mx and (i and a[i] > a[i - 1] or (i + 1 < n and a[i] > a[i + 1])):
			ind = i + 1
			break
	print(ind)


import sys
from math import sqrt
from collections import defaultdict
inpt = sys.stdin.readline

def inp():
	return int(inpt())

def inlist():
	return list(map(int, inpt().split()))

def instr():
	s = inpt()
	return list(s[:len(s) - 1])

def inbitstr():
	s = inpt()
	return [int(i) for i in list(s[:len(s) - 1])]

def invr():
	return map(int, inpt().split())

def printlist(a):
	for i in range(len(a)):
		print(a[i], end='')
	print()

class Graph:

	def __init__(self, n):
		self.n = n
		self.graph = defaultdict(list)
		self.marked = defaultdict(int)
		self.wt = defaultdict(int)

	def addEdge(self, u, v, wt):
		self.graph[u].append(v)
		self.graph[v].append(u)
		self.wt[n * u + v] = wt

	def cleanup(self):
		self.marked = defaultdict(int)

	def dfs(self, u):
		self.marked[u] = 1
		(max, maxnode) = (0, u)
		for i in self.graph[u]:
			(cur, node) = (0, 0)
			if self.marked[i] == 0:
				(cur, node) = self.dfs(i)
			if cur > max:
				max = cur
				maxnode = node
		return (1 + max, maxnode)

	def lngdfs(self, u, v):
		self.marked[u] = 1
		max = self.n
		for i in self.graph[u]:
			if i == v:
				return 1
			cur = self.n
			if self.marked[i] == 0:
				cur = self.lngdfs(i, v)
			if cur < max:
				max = cur
		return 1 + max

def main():
	t = inp()
	for l in range(t):
		n = inp()
		a = inlist()
		maxa = max(a)
		escflag = False
		ans = -1
		for i in range(n):
			if maxa == a[i]:
				if i == 0:
					chkcon = a[i + 1] < a[i]
				elif i == n - 1:
					chkcon = a[i - 1] < a[i]
				else:
					chkcon = a[i - 1] < a[i] or a[i + 1] < a[i]
				if chkcon:
					ans = i + 1
					escflag = True
					break
		print(ans)
main()


for t in range(int(input())):
	n = int(input())
	M = [int(i) for i in input().split()]
	N = set(M)
	(lar, ans) = (0, 0)
	(count, flag) = (0, 0)
	(pos, ros) = (0, 0)
	if len(N) == 1:
		ans = -1
	else:
		for i in range(n):
			if M[i] > lar:
				lar = M[i]
				pos = i
				ans = i + 1
				count = 0
			elif M[i] == lar:
				pos = i
				count += 1
			elif M[i] < lar:
				if ros == 0 and count == i - 1:
					ans = i
					flag = 1
			elif flag == 1:
				break
	print(ans)


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	i = a.index(m)
	if i == 0:
		while 1:
			if a[i + 1] < m:
				print(i + 1)
				break
			elif a[i + 1] == m:
				i += 1
				if i + 1 == n:
					print('-1')
					break
	else:
		print(i + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	ans = -1
	if max(a) == min(a):
		print(-1)
		continue
	else:
		M = max(a)
		for i in range(n):
			if a[i] == M:
				if i > 0:
					if a[i - 1] != M:
						ans = i + 1
						break
				if i < n - 1:
					if a[i + 1] != M:
						ans = i + 1
						break
		print(ans)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().strip().split()))
	m = max(arr)
	for i in range(n):
		if arr[i] == m:
			break
	flag = False
	if i == 0:
		for j in range(1, n):
			if arr[j] != m:
				flag = True
				break
		if j == n - 1 and flag == False:
			print(-1)
		else:
			print(j)
	else:
		print(i + 1)


def main_func(x: str):
	entries = list(map(int, x.split()))
	for i in range(len(entries)):
		if recursion(entries.copy(), i):
			return i + 1
	else:
		return -1

def recursion(li, index):
	if len(li) == 1:
		return True
	if index + 1 < len(li):
		if li[index] > li[index + 1]:
			li.pop(index + 1)
			li[index] += 1
			if recursion(li, index):
				return True
	if index - 1 > -1:
		if li[index] > li[index - 1]:
			li.pop(index - 1)
			index = index - 1
			li[index] += 1
			if recursion(li, index):
				return True
	return False

def test_func1(x: str):
	entries = list(map(int, x.split()))
	max_el = max(entries)
	for i in range(len(entries)):
		if entries[i] == max_el:
			if i > 0:
				if entries[i - 1] < max_el:
					return i + 1
			if i < len(entries) - 1:
				if entries[i + 1] < max_el:
					return i + 1
	else:
		return -1
t = input()
r = ''
for i in range(int(t)):
	r = input()
	l = input()
	print(test_func1(l))


t = int(input())
for z in range(t):
	n = int(input())
	a = list(map(int, input().strip().split()))[:n]
	maxl = max(a)
	maxpos = a.index(max(a))
	flag = 0
	for i in a:
		if i != maxl:
			flag = 1
	if flag == 0:
		print(-1)
		continue
	if a[maxpos - 1] < maxl and maxpos > 0 or (a[maxpos + 1] < maxl and maxpos < n - 1):
		print(maxpos + 1)
		continue
	flag = 0
	for i in range(n):
		if i > 0:
			if a[i] > a[i - 1] and a[i] + 1 > maxl:
				print(i + 1)
				flag = 1
				break
		if i < n - 1:
			if a[i] > a[i + 1] and a[i] + 1 > maxl:
				print(i + 1)
				flag = 1
				break
	if flag == 0:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	arr = [int(num) for num in input().split(' ')]
	if len(set(arr)) == 1:
		ans = -1
	else:
		x = max(arr)
		ans = -1
		for i in range(1, n - 1):
			if arr[i] == x and (arr[i + 1] != x or arr[i - 1] != x):
				ans = i + 1
				break
		if arr[0] == x and arr[1] != x:
			ans = 1
		elif arr[-1] == x and arr[-2] != x:
			ans = n
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	aa = max(a)
	if len(set(a)) == 1:
		print(-1)
	else:
		for i in range(n):
			if a[i] == aa:
				if i == 0:
					if a[1] < a[0]:
						print(1)
						break
				elif i == n - 1:
					if a[n - 2] < a[n - 1]:
						print(n)
						break
				elif a[i] == a[i + 1] and a[i] == a[i - 1]:
					pass
				else:
					print(i + 1)
					break


def solve(pirahnas, n):
	maxima = []
	max_val = 0
	for i in range(n):
		if pirahnas[i] > max_val:
			max_val = pirahnas[i]
			maxima = [i]
		elif pirahnas[i] == max_val:
			maxima.append(i)
	if len(maxima) == n:
		return -1
	else:
		for i in range(len(maxima)):
			if i != maxima[i]:
				return maxima[i] + 1
		return maxima[-1] + 1

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		pirahnas = [int(a) for a in input().split()]
		assert len(pirahnas) == n
		answer = solve(pirahnas, n)
		print(answer)
main()


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	k = a[0]
	flag = 0
	for i in range(n):
		if a[i] != k:
			flag = 1
			break
	if flag == 0:
		print(-1)
		continue
	t = a[0]
	maxa = t
	maxindex = 0
	for i in range(n):
		if a[i] > maxa:
			maxindex = i
			maxa = a[i]
	for i in range(n):
		if a[i] == maxa and i > 0 and (a[i - 1] < maxa):
			print(i + 1)
			break
		if a[i] == maxa and i < n - 1 and (a[i + 1] < maxa):
			print(i + 1)
			break


t = int(input())
for _ in range(t):
	n = int(input())
	A = [int(a) for a in input().split()]
	if len(set(A)) == 1:
		print(-1)
	else:
		m = max(A)
		for (i, a) in enumerate(A):
			if a == m and (i > 0 and A[i - 1] != m or (i < len(A) and A[i + 1] != m)):
				print(i + 1)
				break


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	mx = 0
	for x in a:
		if x > mx:
			mx = x
	possible = False
	for x in a:
		if x != mx:
			possible = True
	if not possible:
		print('-1')
	else:
		for i in range(n):
			if a[i] == mx and (i < n - 1 and a[i + 1] != mx or (i > 0 and a[i - 1] != mx)):
				print(i + 1)
				break


cases = int(input())
while cases:
	cases -= 1
	num = int(input())
	arr = list(map(int, input().split()))
	mn = min(arr)
	mx = max(arr)
	if mn == mx:
		print(-1)
	else:
		count = 0
		rem = 0
		strt = False
		printed = False
		first = False
		for (i, n) in enumerate(arr, start=1):
			if n == mx:
				strt = True
				if not first:
					first = True
					rem = i
			elif strt:
				print(i - 1)
				printed = True
				break
		if not printed:
			print(rem)


import os
from heapq import heapify, heappop, heappush
import sys
import math
import operator
import bisect
from collections import defaultdict
from io import BytesIO, IOBase
sys.setrecursionlimit(10 ** 5)

def inpt():
	return [int(k) for k in input().split()]

def main():
	for _ in range(int(input())):
		n = int(input())
		ar = inpt()
		mx = max(ar)
		st = set(ar)
		if len(st) == 1:
			print(-1)
			continue
		ok = False
		for i in range(0, n):
			if i + 1 < n and (ar[i] == mx and ar[i + 1] < ar[i]):
				ok = True
				print(i + 1)
				break
			if i - 1 >= 0 and (ar[i] == mx and ar[i - 1] < ar[i]):
				ok = True
				print(i + 1)
				break
		if not ok:
			print(-1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys

def solve(n, arr):
	max = -sys.maxsize
	min = sys.maxsize
	for i in range(len(arr)):
		if i != 0 and arr[i] == max and (i == max_idx + 1):
			continue
		if arr[i] > max:
			max = arr[i]
			max_idx = i
	for i in range(len(arr)):
		if arr[i] < min:
			min = arr[i]
			min_idx = i
	if max == min:
		return -1
	temp = max_idx
	flag = True
	while True:
		if flag:
			if max_idx < n - 1 and arr[max_idx] == max:
				if arr[max_idx] > arr[max_idx + 1]:
					return max_idx + 1
				max_idx += 1
				continue
		flag = False
		max_idx = temp
		if max_idx > 0 and arr[max_idx] == max:
			if arr[max_idx] > arr[max_idx - 1]:
				return max_idx + 1
			max_idx -= 1
for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print(solve(n, arr))


def solve(n, arr):
	res = max(arr)
	for i in range(n):
		if arr[i] == res:
			if arr[i] > arr[max(i - 1, 0)] or arr[i] > arr[min(i + 1, n - 1)]:
				return i + 1
	return -1
t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(i) for i in input().split()]
	print(solve(n, arr))


for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	if len(set(s)) == 1:
		print(-1)
	else:
		m = max(s)
		for i in range(1, n):
			if s[i] != s[i - 1]:
				if s[i] == m:
					print(i + 1)
					break
				elif s[i - 1] == m:
					print(i)
					break


from typing import List

def index(size: List[int], candidate: int) -> int:
	for i in range(len(size)):
		if i + 1 < len(size) and size[i] == candidate and (size[i + 1] < size[i]):
			return i
		if i > 0 and size[i] == candidate and (size[i - 1] < size[i]):
			return i
n = int(input())
for _ in range(n):
	_ = int(input())
	size = list(map(int, input().split()))
	if len(set(size)) == 1:
		print(-1)
	else:
		print(1 + index(size, max(size)))


from math import *
from collections import *
from itertools import *
from functools import *
from bisect import *
from heapq import *
from operator import *
from sys import *
setrecursionlimit(100000000)
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if l == [l[0]] * n:
		print(-1)
		continue
	x = max(l)
	ans = 0
	for i in range(n):
		if l[i] == x:
			if i != 0 and l[i - 1] != x or (i != n - 1 and l[i + 1] != x):
				ans = i + 1
				break
	print(ans)


from sys import stdin, stdout
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	lst = []
	lst = [int(x) for x in stdin.readline().split()]
	m = 0
	for i in range(0, n):
		if lst[i] > m:
			m = lst[i]
	index = -1
	for i in range(0, n):
		if lst[i] == m:
			if i - 1 >= 0 and lst[i - 1] != m:
				index = i
				break
			if i + 1 < n and lst[i + 1] != m:
				index = i
				break
	if index == -1:
		print(-1)
		continue
	print(index + 1)


def ans(ar, n):
	k = max(ar)
	for i in range(1, len(ar) - 1):
		if ar[i] == k and (ar[i - 1] < k or ar[i + 1] < k):
			return i + 1
	if ar[0] == k:
		return 1
	else:
		return n
for _ in range(int(input())):
	n = int(input())
	ar = [int(i) for i in input().split()]
	if min(ar) == max(ar):
		print(-1)
	else:
		print(ans(ar, n))


testcases = int(input())
for _ in range(testcases):
	n = int(input())
	l = list(map(int, input().split()))
	if l.count(l[0]) == n:
		print(-1)
	else:
		m = max(l)
		ans = l.index(m)
		if ans == 0:
			while True:
				if ans == n - 1:
					break
				if l[ans] == l[ans + 1]:
					ans += 1
					continue
				else:
					break
		print(ans + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	m = max(a)
	ans = -1
	for i in range(n):
		z = False
		if a[i] == m:
			if i == 0:
				if a[i] > a[i + 1]:
					z = True
			elif i == n - 1:
				if a[i - 1] < a[i]:
					z = True
			elif a[i - 1] < a[i] or a[i] > a[i + 1]:
				z = True
			if z:
				ans = i + 1
				break
	print(ans)


import sys
input = sys.stdin.readline
from collections import defaultdict as dc
from bisect import bisect_right
import math
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	for i in range(n):
		if l[i] == m:
			if i - 1 >= 0 and l[i - 1] < l[i]:
				break
			elif i + 1 <= n - 1 and l[i + 1] < l[i]:
				break
	if len(set(l)) == 1:
		print(-1)
	else:
		print(i + 1)


t = int(input())
for test in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	temp = arr[0]
	check = arr.count(temp)
	if check != n:
		maxx = max(arr)
		for i in range(n):
			if arr[i] == maxx:
				if i - 1 >= 0:
					if arr[i - 1] < arr[i]:
						print(i + 1)
						break
				if i + 1 <= n - 1:
					if arr[i + 1] < arr[i]:
						print(i + 1)
						break
	else:
		print(-1)


for nt in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	k = max(lst)
	if len(set(lst)) == 1:
		print(-1)
	else:
		for i in range(0, n):
			if i >= 1 and lst[i - 1] < k and (lst[i] == k) or (i <= n - 2 and lst[i + 1] < k and (lst[i] == k)):
				r = i + 1
				break
		print(r)


t = int(input())
for test in range(t):
	n = int(input())
	a = list(map(int, input().rstrip().split()))
	m = max(a)
	flag = -1
	for i in range(n - 1):
		if a[i] == m and a[i + 1] != m:
			flag = i + 1
	for i in range(n - 1, 0, -1):
		if a[i] == m and a[i - 1] != m:
			flag = i + 1
	print(flag)


t = int(input())
while t:
	n = int(input())
	ans = -1
	ar = list(map(int, input().split()))
	max = ar[0]
	for i in range(1, n):
		if ar[i] != ar[i - 1]:
			if ar[i] >= ar[i - 1]:
				if ar[i] >= max:
					max = ar[i]
					ans = i
			elif ar[i - 1] >= max:
				max = ar[i - 1]
				ans = i - 1
	if ans != -1:
		print(ans + 1)
	else:
		print(-1)
	t -= 1


from collections import deque
from collections import Counter
from itertools import permutations
import heapq

def counterExample():
	arr = [1, 3, 4, 1, 2, 1, 1, 3, 4, 3, 5, 1, 2, 5, 3, 4, 5]
	counter = Counter(arr)
	top_three = counter.most_common(3)
	print(top_three)
q = deque()
import math

def main():
	t = int(input())
	while t >= 1:
		t -= 1
		n = int(input())
		l = [int(i) for i in input().split()]
		maxi = max(l)
		ok = 0
		for (poz, i) in enumerate(l, 0):
			if i != maxi:
				if poz - 1 >= 0 and l[poz - 1] == maxi:
					print(poz - 1 + 1)
					ok = 1
					break
				elif poz + 1 < len(l) and l[poz + 1] == maxi:
					print(poz + 1 + 1)
					ok = 1
					break
		if ok == 0:
			print(-1)
main()


for _ in range(int(input())):
	l = int(input())
	ar = list(map(int, input().split()))
	mx = max(ar)
	id = ar.index(mx)
	if ar.count(mx) == len(ar):
		print(-1)
	else:
		if id == 0:
			while ar[id] == ar[id + 1]:
				id += 1
		print(id + 1)


t = int(input())
for i in range(t):
	n = int(input())
	ar = list(map(int, input().split()))
	f = True
	m = max(ar)
	for j in range(n):
		if ar[j] == m:
			if j != 0 and j != n - 1:
				if ar[j - 1] < m or ar[j + 1] < m:
					print(j + 1)
					f = False
					break
			elif j == 0:
				if ar[j + 1] < m:
					print(j + 1)
					f = False
					break
			elif j == n - 1:
				if ar[j - 1] < m:
					print(j + 1)
					f = False
					break
	if f:
		print(-1)


def f(lst):
	g = max(lst)
	for i in range(n):
		if g == lst[i]:
			if i == 0:
				if lst[i + 1] < lst[i]:
					return i + 1
			elif i == n - 1:
				if lst[i - 1] < lst[i]:
					return i + 1
			elif lst[i + 1] < lst[i]:
				return i + 1
			elif lst[i - 1] < lst[i]:
				return i + 1
	return -1
for i in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	print(f(lst))


for _ in range(int(input())):
	n = int(input())
	list1 = list(map(int, input().split()))
	p = max(list1)
	if len(set(list1)) == 1:
		print(-1)
		continue
	for i in range(0, len(list1)):
		if list1[i] == p and i + 1 < n and (list1[i + 1] != p):
			print(i + 1)
			break
		elif list1[i] == p and i - 1 >= 0 and (list1[i - 1] != p):
			print(i + 1)
			break


_39 = '1445b'
_40 = '1445a'
_41 = '1437a'
_42 = '1433c'
for i in range(int(input())):
	n = int(input())
	x = list(map(int, input().split()))
	m = max(x)
	ind = -1
	for i in range(len(x)):
		if x[i] == m and (i > 0 and x[i] > x[i - 1] or (i < n - 1 and x[i] > x[i + 1])):
			ind = i + 1
	print(ind)


from sys import stdin, stdout
t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	if len(set(arr)) == 1:
		print(-1)
		continue
	m = max(arr)
	p = -1
	for i in range(n):
		if arr[i] == m:
			if i - 1 >= 0 and arr[i - 1] < m or (i + 1 <= n - 1 and arr[i + 1] < m):
				p = i + 1
				break
	print(p)


for i in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	if len(s) == s.count(s[0]):
		print(-1)
	else:
		i = s.index(max(s))
		if i < n - 1 and s[i] > s[i + 1] or (i > 0 and s[i] > s[i - 1]):
			print(i + 1)
		else:
			while i < n - 1 and s[i] == s[i + 1]:
				i = i + 1
			print(i + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	ans = 0
	flag = 0
	if l[0] == m and l[0] > l[1]:
		ans = 0
		flag = 1
	if l[n - 1] == m and l[n - 1] > l[n - 2]:
		ans = n - 1
		flag = 1
	if flag == 0:
		for i in range(1, n - 1):
			if l[i] == m:
				if l[i] > l[i - 1] or l[i] > l[i + 1]:
					ans = i
					break
	if flag == 0 and ans == 0:
		ans = -2
	print(ans + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split(' ')]
	m = max(a)
	ans = -2
	for j in range(n):
		if a[j] == m and j > 0 and (a[j] > a[j - 1]):
			ans = j
		if a[j] == m and j < n - 1 and (a[j] > a[j + 1]):
			ans = j
	print(ans + 1)


for _ in range(int(input())):
	n = int(input())
	x = list(map(int, input().split()))
	idx = x.index(max(x))
	if idx == 0:
		for i in range(1, len(x)):
			if x[i] != x[0]:
				print(i)
				break
		else:
			print(-1)
	else:
		print(idx + 1)


n = int(input())
for i in range(n):
	l = int(input())
	fish = list(map(int, input().strip().split()))[:l]
	dFish = max(fish)
	dFish_pos = fish.index(max(fish))
	pos = -1
	for i in range(l):
		if i > 0:
			if fish[i] > fish[i - 1] and fish[i] == dFish:
				pos = i + 1
				break
		if i < l - 1:
			if fish[i] > fish[i + 1] and fish[i] == dFish:
				pos = i + 1
				break
	print(pos)


def can_eat(idx, aquarium):
	if idx > 0 and aquarium[idx - 1] < aquarium[idx]:
		return True
	return idx < len(aquarium) - 1 and aquarium[idx + 1] < aquarium[idx]
cases = int(input().strip())
for case in range(cases):
	aquarium_len = int(input().strip())
	aquarium = [int(x) for x in input().strip().split(' ')]
	max_fish = max(aquarium)
	last_fish_idx = -1
	for (idx, fish) in enumerate(aquarium):
		if fish == max_fish and can_eat(idx, aquarium):
			last_fish_idx = idx + 1
	print(last_fish_idx)


import sys, collections
tc = int(sys.stdin.readline())
for _ in range(tc):
	n = int(sys.stdin.readline())
	arr = list(map(int, sys.stdin.readline().split()))
	flag = max(arr)
	find = False
	for i in range(n):
		temp = arr[i]
		if i == 0:
			if temp > arr[i + 1]:
				temp += 1
				if temp > flag:
					print(i + 1)
					find = True
					break
		elif i == n - 1:
			if temp > arr[i - 1]:
				temp += 1
				if temp > flag:
					print(i + 1)
					find = True
					break
		else:
			if temp > arr[i - 1]:
				temp += 1
			if temp > arr[i + 1]:
				temp += 1
			if temp > flag:
				print(i + 1)
				find = True
				break
	if not find:
		print(-1)


def fun(n):
	z = set(n)
	if len(z) == 1 and len(n) != 1:
		return -1
	if len(n) == 1:
		return 1
	a = 0
	while n[a] == n[a + 1]:
		a += 1
	z = a
	for i in range(z, len(n)):
		if n[i] > n[z]:
			z = i
	return z + 1
y122 = int(input())
for _ in range(y122):
	z = int(input())
	n = list(map(int, input().strip().split()))
	print(fun(n))


n = int(input())
for i in range(n):
	count = int(input())
	sharks = [int(x) for x in input().split()]
	deltaMax = 0
	indexOfSuperShark = -1
	maxSharkWeight = max(sharks)
	for j in range(len(sharks) - 1):
		delta = abs(sharks[j] - sharks[j + 1])
		if delta > deltaMax and (sharks[j] == maxSharkWeight or sharks[j + 1] == maxSharkWeight):
			deltaMax = delta
			indexOfSuperShark = j + 1 if sharks[j] > sharks[j + 1] else j + 2
	if indexOfSuperShark == -1:
		print(-1)
	else:
		print(indexOfSuperShark)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		n = int(input())
		fish = list(map(int, input().split()))
		maxFish = max(fish)
		if sum(fish) / n == maxFish:
			yield (-1)
		else:
			for (i, ele) in enumerate(fish):
				if ele == maxFish:
					if i == 0:
						if fish[i + 1] == maxFish:
							continue
						else:
							yield 1
							break
					elif i == n - 1:
						if fish[i - 1] == maxFish:
							continue
						else:
							yield n
							break
					elif fish[i - 1] != maxFish or fish[i + 1] != maxFish:
						yield (i + 1)
						break
t = int(input())
ans = gift()
print(*ans, sep='\n')


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split(' ')))
	ans = -1
	m = max(a)
	for i in range(n):
		if a[i] == m:
			d = False
			if i + 1 < n and a[i] > a[i + 1]:
				d = True
			if i - 1 > -1 and a[i] > a[i - 1]:
				d = True
			if d:
				ans = i + 1
				break
	print(ans)


tc = int(input())
for _ in range(tc):
	n = int(input())
	arr = list(map(int, input().split()))
	x = max(arr)
	y = arr.index(x)
	flag = 0
	if y == 0:
		for i in range(n):
			if arr[i] != x:
				flag = 1
				y = i
				break
		if flag == 1:
			print(y)
		else:
			print(-1)
	else:
		print(y + 1)


import collections
t = int(input())
for q in range(0, t):
	n = int(input())
	a = [int(i) for i in input().split()]
	d = collections.Counter(a)
	if len(d) == 1:
		print(-1)
	else:
		index = -1
		m = max(a)
		for i in range(0, n - 1):
			if a[i + 1] < a[i] and m == a[i]:
				index = i + 1
				break
		if index == -1:
			for i in range(1, n):
				if a[i - 1] < a[i] and m == a[i]:
					index = i + 1
					break
		print(index)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
	else:
		m = max(l)
		idx = -1
		for i in range(n):
			if l[i] == m:
				if i == 0:
					if l[i + 1] < m:
						idx = i + 1
						break
				elif i == n - 1:
					if l[i - 1] < m:
						idx = i + 1
						break
				elif l[i + 1] < m or l[i - 1] < m:
					idx = i + 1
					break
		print(idx)


for _ in range(int(input())):
	n = int(input())
	nums = [int(i) for i in input().split()]
	max_ = max(nums)
	c = nums.count(max_)
	if c == 1:
		print(nums.index(max_) + 1)
	elif c == n:
		print(-1)
	else:
		for i in range(n):
			if nums[i] == max_:
				if i > 0 and nums[i - 1] < max_:
					print(i + 1)
					break
				if i + 1 < n:
					if nums[i + 1] < max_:
						print(i + 1)
						break


def find_dominant(fish):
	biggest_size = max(fish)
	for i in range(len(fish)):
		if fish[i] == biggest_size:
			if i > 0 and fish[i - 1] < biggest_size or (i < len(fish) - 1 and fish[i + 1] < biggest_size):
				return i + 1
	return -1
for i in range(int(input())):
	n = input()
	print(find_dominant([int(i) for i in input().split()]))


from sys import stdin
tt = int(stdin.readline())
for loop in range(tt):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	M = max(a)
	ans = -1
	for i in range(n):
		if a[i] == M:
			if i != 0 and a[i - 1] < a[i]:
				ans = i + 1
				break
			if i != n - 1 and a[i + 1] < a[i]:
				ans = i + 1
				break
	print(ans)


for _ in range(int(input())):
	input()
	seq = list(map(int, input().split()))
	if max(seq) != min(seq):
		dom = max(seq)
		for (i, x) in enumerate(seq):
			if x == dom and (i + 1 < len(seq) and seq[i + 1] < x or (i - 1 >= 0 and seq[i - 1] < x)):
				print(i + 1)
				break
	else:
		print(-1)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def prod(a, mod=10 ** 9 + 7):
	ans = 1
	for each in a:
		ans = ans * each % mod
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if True else 1):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
		continue
	ma = max(a)
	ans = 0
	for i in range(n):
		if a[i] == ma and (i and a[i - 1] != ma or (i != n - 1 and a[i + 1] != ma)):
			ans = i
			break
	print(ans + 1)


ns = lambda : input()
ni = lambda : int(input())
nm = lambda : map(int, input().split())
nl = lambda : list(map(int, input().split()))
for _ in range(ni()):
	n = ni()
	a = nl()
	m = ind = summ = 0
	for i in range(n):
		summ += a[i]
		if a[i] > m:
			m = a[i]
		if i - 1 > -1:
			if a[i - 1] < m and a[i] == m:
				ind = i
		if i + 1 < n:
			if a[i + 1] < m and a[i] == m:
				ind = i
	if summ == n * m:
		print(-1)
	else:
		print(ind + 1)


t = int(input())

def check_before(size, ls, i):
	if i - 1 < 0:
		return False
	if ls[i - 1] != size:
		return True
	return False

def check_after(size, ls, i):
	if i + 1 >= len(ls):
		return False
	if ls[i + 1] != size:
		return True
	return False

def check_bigger(sizes):
	biggest_i = 0
	biggest_s = 0
	first = sizes[0]
	flag = True
	repeated = []
	for (i, size) in enumerate(sizes):
		if size != first:
			flag = False
		if size >= biggest_s:
			biggest_s = size
			biggest_i = i
			repeated.append((biggest_s, biggest_i))
	if flag:
		return -1
	else:
		j = 0
		while j < len(repeated) and repeated[j][0] < biggest_s:
			j += 1
		repeated = repeated[j:]
		for (size, i) in repeated:
			if check_before(size, sizes, i) or check_after(size, sizes, i):
				return i + 1
for _ in range(t):
	n = int(input())
	sizes = list(map(int, input().split()))
	resp = check_bigger(sizes)
	print(resp)


case = int(input())
for i in range(case):
	x = int(input())
	y = [int(v) for v in input().split()]
	localmax = y[0]
	count = 0
	for j in range(1, len(y)):
		if y[j] == localmax:
			count += 1
		else:
			localmax = max(y[j], localmax)
	if count == x - 1:
		print(-1)
	else:
		z = y.index(localmax) + 1
		if z == 1:
			for k in range(1, len(y)):
				if y[k] == y[k - 1]:
					z += 1
				else:
					break
		print(z)


t = int(input())
for t in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	mi = l[0]
	ma = l[0]
	z = 0
	for i in range(n):
		if l[i] > ma:
			ma = l[i]
			z = i
		if l[i] < mi:
			mi = l[i]
	if mi == ma:
		print(-1)
	else:
		for i in range(n):
			if i == 0:
				if l[i] == ma:
					if l[i + 1] < l[i]:
						z = i
						break
			elif i == n - 1:
				if l[i] == ma:
					if l[i - 1] < l[i]:
						z = i
						break
			elif l[i] == ma and (l[i - 1] < l[i] or l[i + 1] < l[i]):
				z = i
				break
		print(z + 1)


import math
test = int(input())
for t in range(test):
	tt = 0
	pp = 0
	cc = ''
	ss = ''
	dd = 1
	cnttt = 0
	n = int(input())
	A = list(map(int, input().split()))
	a = max(A)
	ans = -1
	for i in range(n):
		if a == A[i]:
			if i >= 1 and A[i - 1] < a:
				ans = i + 1
				break
			if i < n - 1 and A[i + 1] < a:
				ans = i + 1
				break
	print(ans)


def dominant_piranha(piranhas):
	index = -1
	max_element = max(piranhas)
	for i in range(len(piranhas)):
		if piranhas[i] == max_element:
			if i > 0 and piranhas[i - 1] < max_element or (i < len(piranhas) - 1 and piranhas[i + 1] < max_element):
				index = i + 1
				break
	return index
t = int(input())
for i in range(t):
	n = int(input())
	piranhas = [int(x) for x in input().split()]
	print(dominant_piranha(piranhas))


t = int(input())
for _ in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	max_ele = max(li)
	if li == [max_ele] * n:
		print('-1')
		continue
	for (ind, i) in enumerate(li):
		if i == max_ele:
			li[ind] = 1
		else:
			li[ind] = 0
	for (ind, i) in enumerate(li):
		if ind + 1 < n:
			if i == 1 and li[ind + 1] == 0:
				print(ind + 1)
				break
			if i == 0 and li[ind + 1] == 1:
				print(ind + 1 + 1)
				break


x = int(input())
for i in range(0, x):
	n = int(input())
	m = list(map(int, input().split()))[:n]
	d = max(m)
	s = -1
	for j in range(0, n):
		if m[j] == d:
			if j:
				if m[j - 1] != d:
					s = j + 1
			if j != n - 1:
				if m[j + 1] != d:
					s = j + 1
	print(s)


for _ in range(int(input())):
	n = int(input())
	x = list(map(int, input().split(' ')))
	maximum = sorted(x)[-1]
	y = -1
	if len(set(x)) > 1:
		for i in range(n - 1):
			if x[i] == maximum > x[i + 1]:
				y = i
				break
		if y == -1:
			for j in range(n - 1, 0, -1):
				if x[j] == maximum > x[j - 1]:
					y = j
					break
		print(y + 1)
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if a.count(a[0]) == n:
		print(-1)
	else:
		x = max(a)
		for i in range(n):
			if a[i] == x and i + 1 < n and (a[i + 1] < x):
				print(i + 1)
				break
			if a[i] == x and i - 1 >= 0 and (a[i - 1] < x):
				print(i + 1)
				break


from collections import *
import sys
input = sys.stdin.readline

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))
t = ri()
for _ in range(t):
	n = ri()
	aa = rl()
	maxi = max(aa)
	ans = -2
	for i in range(n):
		if aa[i] == maxi:
			if i - 1 >= 0 and aa[i - 1] < maxi:
				ans = i
				break
			if i + 1 <= n - 1 and aa[i + 1] < maxi:
				ans = i
				break
	print(ans + 1)


for _ in range(int(input())):
	N = int(input())
	array = [int(x) for x in input().split()]
	if len(set(array)) == 1:
		print(-1)
	else:
		dominant = max(array)
		for i in range(N):
			if array[i] == dominant:
				if i == 0:
					if array[i + 1] != dominant:
						print(i + 1)
						break
				elif i == N - 1:
					if array[i - 1] != dominant:
						print(i + 1)
						break
				elif array[i + 1] != dominant or array[i - 1] != dominant:
					print(i + 1)
					break


for i in range(int(input())):
	n = int(input())
	p = list(input().split())
	if len(p) == p.count(p[0]):
		print(-1)
	else:
		nl = []
		for item in p:
			nl.append(int(item))
		b = max(nl)
		midx = nl.index(b)
		if midx == 0:
			i = 0
			while True:
				if nl[i] != b:
					midx = i - 1
					break
				i += 1
		print(midx + 1)


import sys, os
from math import sqrt, gcd, ceil, log, floor
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))
MOD = 10 ** 9 + 7

def main():
	ans_ = []
	for _ in range(int(input())):
		n = int(input())
		arr = read()
		if len(set(arr)) == 1:
			ans_.append('-1')
		else:
			x = max(arr)
			for i in range(n):
				if arr[i] == x:
					if i + 1 < n and arr[i + 1] < x:
						ind = i + 1
					elif i - 1 > -1 and arr[i - 1] < x:
						ind = i + 1
			ans_.append(str(ind))
	print('\n'.join(ans_))
main()


from sys import stdout, stdin
from collections import defaultdict, deque
import math
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	l = list(map(int, stdin.readline().split()))
	flag = True
	for i in range(1, n):
		if l[i] != l[0]:
			flag = False
			break
	if flag:
		print(-1)
	else:
		m = max(l)
		if l[0] == m and l[1] < m:
			print(1)
		elif l[n - 1] == m and l[n - 2] < m:
			print(n)
		else:
			for i in range(1, n - 1):
				if l[i] == m:
					if l[i - 1] < m or l[i + 1] < m:
						print(i + 1)
						break


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	max = 0
	max_mas = []
	for i in range(n):
		if a[i] > max:
			max = a[i]
			max_mas = [i]
		elif a[i] == max:
			max_mas += [i]
	if max_mas == list(range(len(a))):
		print(-1)
	else:
		for i in max_mas:
			if i - 1 >= 0 and a[i - 1] < a[i] or (i + 1 <= n and a[i + 1] < a[i]):
				print(i + 1)
				break


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	count = 0
	c = 0
	for i in arr:
		if i == arr[0]:
			count += 1
	d = max(arr)
	flag = False
	for i in range(n):
		if arr[i] == d and (not flag):
			if i == 0 and arr[i] > arr[i + 1]:
				c = i
				flag = True
			elif i == n - 1 and arr[i] > arr[i - 1]:
				c = i
				flag = True
			elif i > 0 and i < n - 1:
				if arr[i] > arr[i - 1] or arr[i] > arr[i + 1]:
					c = i
					flag = True
	if count == n:
		print(-1)
	else:
		print(c + 1)


for _ in range(int(input())):
	arr_len = int(input())
	num_list = list(map(int, input().split()))
	max_num = max(num_list)
	if len(set(num_list)) == 1:
		print(-1)
	elif num_list[0] == max_num and num_list[0] > num_list[1]:
		print(1)
	elif num_list[-1] == max_num and num_list[-1] > num_list[-2]:
		print(arr_len)
	else:
		for i in range(1, len(num_list) - 1):
			if num_list[i] == max_num and (num_list[i] > num_list[i + 1] or num_list[i] > num_list[i - 1]):
				print(i + 1)
				break


t = int(input())
for i in range(t):
	n = int(input())
	f = list(map(int, input().split()))
	maxF = max(f)
	minF = min(f)
	if maxF == minF:
		print(-1)
	else:
		for j in range(n):
			if f[j] == maxF:
				if j > 0 and f[j] > f[j - 1] or (j < n - 1 and f[j] > f[j + 1]):
					domF = j
		print(domF + 1)


tests = int(input())
answers = []
for test in range(tests):
	n = int(input())
	x = list(map(int, input().split()))
	f = max(x)
	for i in range(len(x)):
		if i < n - 1:
			if x[i] == f and x[i + 1] != f:
				answers.append(i + 1)
				break
		if i > 0:
			if x[i] == f and x[i - 1] != f:
				answers.append(i + 1)
				break
	else:
		answers.append(-1)
for i in answers:
	print(i)


x = int(input())
for i in range(x):
	m = int(input())
	l = list(map(int, input().split()))
	o = max(l)
	if sum(l) // m == o:
		print(-1)
	else:
		for i in range(len(l)):
			if l[i] == o:
				if i < len(l) - 1:
					if l[i + 1] != o:
						print(i + 1)
						break
				if i > 0:
					if l[i - 1] != o:
						print(i + 1)
						break


TC = int(input())
for __ in range(TC):
	n = int(input())
	a = list(map(int, input().split()))
	tmax = 0
	for i in range(1, n):
		if a[tmax] < a[i]:
			tmax = i
		elif a[tmax] == a[i]:
			if a[i] > a[i - 1]:
				tmax = i
			if i != n - 1 and a[i] > a[i + 1]:
				tmax = i
	if min(a) == max(a):
		tmax = -2
	print(tmax + 1)


t = int(input())
for j in range(t):
	n = int(input())
	d = str(input()).split(' ')
	arr = []
	for i in range(n):
		try:
			arr.append(int(d[i]))
		except:
			pass
	mx = max(arr)
	vis = 0
	for i in range(n):
		if arr[i] == mx:
			try:
				if arr[i - 1] < mx and i - 1 >= 0:
					print(i + 1)
					vis = 1
					break
				if arr[i + 1] < mx and i + 1 < n:
					print(i + 1)
					vis = 1
					break
			except:
				pass
	if vis == 0:
		print('-1')


def solve(n, a):
	mi = 1000000000.0 + 1
	mii = -1
	ma = -1
	mai = -1
	for i in range(n):
		va = a[i]
		if va > ma:
			ma = va
			mai = i
	res = []
	for i in range(n):
		if a[i] == a[mai]:
			res.append(i)

	def s(mai):
		if mai > 0 and mai < n - 1:
			if a[mai] > a[mai - 1] or a[mai] > a[mai + 1]:
				return mai
		elif mai == 0:
			if a[mai] > a[mai + 1]:
				return mai
		elif mai == n - 1:
			if a[mai] > a[mai - 1]:
				return mai
		return -1
	for i in res:
		tmp = s(i)
		if tmp != -1:
			return i + 1
	return -1
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	print(solve(n, a))


t = int(input())

def checkio(arr):
	sorted_arr = sorted(arr)
	if sorted_arr[0] == sorted_arr[len(arr) - 1]:
		return -1
	else:
		for i in range(len(arr)):
			if arr[i] == sorted_arr[-1]:
				if i > 0 and i < len(arr) - 1:
					if arr[i - 1] < arr[i] or arr[i + 1] < arr[i]:
						return i + 1
				elif i < len(arr) - 1:
					if arr[i + 1] < arr[i]:
						return i + 1
				elif arr[i - 1] < arr[i]:
					return i + 1
for _ in range(t):
	n = int(input())
	aquarium = list(map(int, input().split(' ')))
	print(checkio(aquarium))


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = a[0]
	k = 0
	if a.count(b) == len(a):
		print(-1)
	else:
		for j in range(len(a)):
			if a[j] > b:
				k = j
				b = a[j]
		q = a.count(a[k])
		if q == 1:
			print(k + 1)
		else:
			for j in range(len(a)):
				if a[j] == a[k]:
					if j != 0 and j != len(a) - 1:
						if a[j - 1] != a[j] or a[j + 1] != a[j]:
							k = j
							break
					elif j == 0:
						if a[j] != a[j + 1]:
							k = j
							break
					elif a[j] != a[j - 1]:
						k = j
						break
			print(k + 1)


import os
from sys import stdin, stdout

def solve(tc):
	n = int(stdin.readline().strip())
	seq = list(map(int, stdin.readline().split()))
	allSame = True
	for i in range(1, n):
		if seq[i] != seq[i - 1]:
			allSame = False
			break
	if allSame:
		print(-1)
		return
	maxi = -1
	ans = -1
	for i in range(n):
		if seq[i] > maxi:
			if i > 0 and seq[i] > seq[i - 1] or (i < n - 1 and seq[i] > seq[i + 1]):
				maxi = seq[i]
				ans = i + 1
	print(ans)
tcs = 1
tcs = int(stdin.readline().strip())
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


def testcase():
	n = int(input())
	arr = list(map(int, input().split()))
	mx = max(arr)
	for i in range(n):
		if arr[i] == mx:
			if i == 0:
				if arr[i + 1] != mx:
					print(1)
					return
			elif i == n - 1:
				if arr[i - 1] != mx:
					print(n)
					return
			elif arr[i - 1] != mx or arr[i + 1] != mx:
				print(i + 1)
				return
	print(-1)
	return
import sys, os
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
t = int(input())
for _ in range(t):
	testcase()


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	l = []
	if a[0] > a[1]:
		l.append(a[0])
	else:
		l.append(-1)
	for i in range(1, len(a) - 1):
		if a[i] > a[i - 1] or a[i] > a[i + 1]:
			l.append(a[i])
		else:
			l.append(-1)
	if a[n - 1] > a[n - 2]:
		l.append(a[n - 1])
	else:
		l.append(-1)
	maxx = max(l)
	p = l.index(maxx)
	if maxx == -1:
		print(-1)
	else:
		print(p + 1)


for ___ in range(int(input())):
	x = int(input())
	a = [int(i) for i in input().split()]
	n = max(a)
	ans = -2
	if x == 1:
		ans = 0
	elif x == 2:
		if a[0] > a[1]:
			ans = 0
		elif a[1] > a[0]:
			ans = 1
	else:
		for i in range(x):
			if a[i] == n:
				if i > 0 and i < x - 1:
					if a[i + 1] < n or a[i - 1] < n:
						ans = i
						break
				elif i == 0:
					if a[i + 1] < n:
						ans = i
						break
				elif i == x - 1:
					if a[i - 1] < n:
						ans = i
						break
	print(ans + 1)


import math
t = int(input())
for w in range(t):
	n = int(input())
	l = [int(i) for i in input().split()]
	m = max(l)
	if l.count(m) == n:
		print(-1)
	else:
		k = 0
		for i in range(1, n - 1):
			if l[i] == m and (l[i - 1] < m or l[i + 1] < m):
				k = i + 1
				break
		if k == 0:
			if l[0] == m and l[1] < m:
				print(1)
			elif l[-1] == m and l[n - 2] < m:
				print(n)
		else:
			print(k)


for cnt in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	m = max(b)
	if min(b) == max(b):
		print(-1)
	else:
		for i in range(n):
			if b[i] == m:
				if i == 0:
					if b[i] > b[i + 1]:
						print(i + 1)
						break
				elif i == n - 1:
					if b[i] > b[i - 1]:
						print(i + 1)
						break
				elif b[i] > b[i - 1] or b[i] > b[i + 1]:
					print(i + 1)
					break


def f():
	input()
	l = [int(a) for a in input().split()]
	m = max(l)
	if m == min(l):
		return -1
	else:
		s = 0
		for i in range(len(l)):
			if l[i] == m:
				if i > 0:
					if l[i - 1] != m:
						return i + 1
				if i < len(l) - 1:
					if l[i + 1] != m:
						return i + 1
for t in range(int(input())):
	print(f())


import os, sys
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		n = int(input())
		arr = list(map(int, input().split()))
		x = max(arr)
		ans = -2
		for (ind, val) in enumerate(arr):
			if val == x:
				if ind and arr[ind - 1] != x:
					ans = ind
					break
				elif ind != n - 1 and arr[ind + 1] != x:
					ans = ind
					break
		print(ans + 1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def ans(n, a):
	c = 0
	for i in range(n - 1):
		if a[i] != a[i + 1]:
			c = 1
			break
	if c == 0:
		return -1
	m = a[0]
	ind = []
	for i in range(n):
		if a[i] > m:
			m = a[i]
			ind = [i]
		if a[i] == m:
			ind.append(i)
	for i in range(len(ind)):
		x = ind[i]
		if x == 0:
			if a[x] > a[x + 1]:
				return 1
		elif x == n - 1:
			if a[x] > a[x - 1]:
				return n
		elif a[x] > a[x + 1] or a[x] > a[x - 1]:
			return x + 1

def answer():
	n = int(input())
	a = [int(x) for x in input().split()]
	print(ans(n, a))
t = int(input())
for i in range(t):
	answer()


t = int(input())
for ii in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	found = False
	for i in l:
		if i != m:
			found = True
			break
	if not found:
		print(-1)
	else:
		found = False
		for i in range(n - 1):
			if l[i] == m and l[i + 1] != m:
				found = i
				break
		if not found:
			for i in range(1, n):
				if l[i] == m and l[i - 1] != m:
					found = i
					break
		print(found + 1)


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	s = set(l)
	m = max(s)
	if len(s) == 1:
		print(-1)
	else:
		ind = l.index(m)
		if ind == 0 and l[ind + 1] == m:
			for j in range(2, n):
				if l[j] != m:
					print(j)
					break
		else:
			print(ind + 1)


t = int(input(''))
for i in range(t):
	n = int(input(''))
	l = list(map(int, input('').split()))
	ll = list(reversed(l))
	a = max(l)
	b = min(l)
	ai = l.index(a)
	aii = n - ll.index(a) - 1
	ans = 0
	if a == b:
		ans = -1
	elif ai != 0:
		if l[ai - 1] < a or l[ai + 1] < a:
			ans = ai + 1
	elif aii != n - 1:
		if l[aii - 1] < a or l[aii + 1] < a:
			ans = aii + 1
	else:
		for k in l:
			if k != a:
				ans = l.index(k)
				break
	print(ans)


for _ in range(int(input())):
	am = int(input())
	arr = list(map(int, input().split()))
	m = max(arr)
	fl = False
	ans = 0
	for i in range(am):
		if arr[i] == m:
			if i == 0:
				if arr[i + 1] < arr[i]:
					fl = True
					ans = i
					break
			elif i == am - 1:
				if arr[i - 1] < arr[i]:
					fl = True
					ans = i
					break
			elif arr[i - 1] < arr[i] or arr[i] > arr[i + 1]:
				fl = True
				ans = i
				break
	if fl:
		print(ans + 1)
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	Max = max(arr)
	if n == 1:
		print(1)
	elif len(set(arr)) == 1:
		print(-1)
	else:
		idx = -1
		for i in range(n):
			if arr[i] == Max:
				if i + 1 < n and arr[i] != arr[i + 1]:
					idx = i + 1
				if i - 1 >= 0 and arr[i] != arr[i - 1]:
					idx = i + 1
		if idx == -1:
			print(-1)
		else:
			print(idx)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	j = set(l)
	if len(j) == 1:
		print(-1)
	else:
		k = max(j)
		for x in range(n - 1):
			if l[x] > l[x + 1] and l[x] + 1 > k:
				print(x + 1)
				break
			elif l[x] < l[x + 1] and l[x + 1] + 1 > k:
				print(x + 2)
				break


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	(m, ans) = (max(a), 0)
	for i in range(n):
		if i == 0 and a[i] == m:
			if i + 1 < n and a[i + 1] < a[i]:
				ans = i + 1
				break
		elif i == n - 1 and a[i] == m and (a[i] > a[i - 1]):
			ans = i + 1
			break
		elif i != 0 and i != n - 1 and (a[i] == m) and (a[i - 1] < a[i] or a[i + 1] < a[i]):
			ans = i + 1
			break
	print(ans if ans != 0 else -1)
for _ in range(int(input())):
	solve()


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
import itertools
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = lambda : sys.stdin.buffer.readline().rstrip()
for _ in range(int(input())):
	q = int(input())
	w = list(map(int, input().split()))
	e = max(w)
	r = 0
	t = 0
	if len(set(w)) == 1:
		print(-1)
	elif w[0] == e and w[1] < e:
		print(1)
	elif w[-1] == e and w[-2] < e:
		print(q)
	else:
		for i in range(1, q - 1):
			if w[i] == e and (w[i] > w[i - 1] or w[i] > w[i + 1]):
				print(i + 1)
				break


def answer(x):
	x = [int(y) for y in x]
	M = max(x)
	for (i, tup) in enumerate(zip(x[:-1], x[1:])):
		(a, b) = tup
		if a == M and b < M:
			return i + 1
		if a < M and b == M:
			return i + 2
	return -1
t = int(input())
for _ in range(t):
	input()
	x = input()
	print(answer(x.split(' ')))


for q in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	for i in range(n):
		if a[i] == mx:
			if i + 1 != n and a[i] > a[i + 1]:
				res = i + 1
				break
			if i != 0 and a[i] > a[i - 1]:
				res = i + 1
				break
	print(-1 if len(set(a)) == 1 else res)


def solve(n):
	s = list(map(int, input().split()))
	if len(set(s)) == 1:
		return -1
	q = max(s)
	for i in range(n):
		if s[i] == q:
			if i != 0 and s[i - 1] != q:
				return i + 1
			elif i != n - 1 and s[i + 1] != q:
				return i + 1
for _ in range(int(input())):
	print(solve(int(input())))


t = int(input())
for w in range(t):
	n = int(input())
	l = [int(x) for x in input().split()]
	max = int(-100000000000.0)
	for k in l:
		if k > max:
			max = k
			index = l.index(k)
	count = 0
	flag = True
	for z in range(len(l)):
		if l[z] == max:
			if flag and z - 1 >= 0 and (z + 1 < len(l)):
				if l[z - 1] != max:
					index = z
					flag = False
				elif l[z + 1] != max:
					index = z
					flag = False
			count += 1
	if count != len(l):
		print(index + 1)
	else:
		print(-1)


import collections

def solve():
	n = int(input())
	S = [int(i) for i in input().split()]
	m = max(S)
	for (i, s) in enumerate(S):
		if s == m and (i != 0 and S[i - 1] != m or (i != n - 1 and S[i + 1] != m)):
			return i + 1
	return -1
N = int(input())
for _ in range(N):
	print(solve())


t = int(input())
for j in range(t):
	kol = int(input())
	fish = [int(i) for i in input().split()]
	ans1 = fish.index(max(fish))
	ans2 = ans1
	if len(set(fish)) == 1:
		print(-1)
	else:
		for i in range(ans1 + 1, kol):
			if fish[ans1] != fish[i]:
				break
			else:
				ans1 += 1
		if ans1 + 1 == kol:
			print(ans2 + 1)
		else:
			print(ans1 + 1)


for _ in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split()]
	ans = -1
	maxi = max(arr)
	for i in range(n):
		if i == 0 and arr[i] == maxi:
			if arr[i + 1] < maxi:
				ans = i + 1
				break
		elif i == n - 1 and arr[i] == maxi:
			if arr[i - 1] < maxi:
				ans = i + 1
				break
		elif arr[i] == maxi:
			if arr[i] > arr[i - 1] or arr[i] > arr[i + 1]:
				ans = i + 1
				break
	print(ans)


import math
t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	a = max(l)
	if len(set(l)) == 1:
		print(-1)
	elif l[0] == a and l[1] != a:
		print(1)
	elif l[-1] == a and l[-2] != a:
		print(n)
	else:
		ans = -1
		for j in range(1, n - 1):
			if l[j] == a and (l[j - 1] != a or l[j + 1] != a):
				ans = j + 1
				break
		print(ans)


def howabido(l):
	a = l[0]
	for i in l:
		if i != a:
			return False
	return True

def lekbir(l, n):
	m = max(l)
	if l[0] > l[1] and l[0] == m:
		return 1
	for i in range(1, n - 1):
		if l[i] == m and (l[i] > l[i - 1] or l[i] > l[i + 1]):
			return i + 1
	if l[n - 1] > l[n - 2] and l[n - 1] == m:
		return n
t = int(input())
for i in range(t):
	n = int(input())
	l = input()
	L = l.split()
	for i in range(n):
		L[i] = int(L[i])
	if howabido(L):
		print(-1)
	else:
		print(lekbir(L, n))


from sys import stdin, stdout
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	m = max(arr)
	x = -1
	if arr.count(m) == n:
		print(x)
	else:
		for i in range(n):
			if arr[i] == m and i == 0 and (arr[i + 1] < arr[i]):
				x = i
				break
			elif arr[i] == m and i == n - 1 and (arr[i - 1] < arr[i]):
				x = i
				break
			elif arr[i] == m and arr[i + 1] < arr[i] and (i > 0):
				x = i
				break
			elif arr[i] == m and arr[i - 1] < arr[i] and (i > 0):
				x = i
				break
		print(x + 1)


t = int(input())
for q in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = max(a)
	for i in range(n):
		if a[i] == b:
			if i == 0:
				if a[1] != a[0]:
					print(1)
					break
			elif i == n - 1:
				if a[n - 2] != a[n - 1]:
					print(n)
					break
			elif a[i] != a[i - 1] or a[i] != a[i + 1]:
				print(i + 1)
				break
	else:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	parahnas = list(map(int, input().split()))
	indexes = []
	maxi = max(parahnas)
	for i in range(len(parahnas)):
		if parahnas[i] == maxi:
			indexes.append(i)
	index = 0
	if len(indexes) == len(parahnas):
		print(-1)
	else:
		for ind in indexes:
			if ind > 0 and parahnas[ind] != parahnas[ind - 1]:
				index = ind + 1
			if ind < n - 1 and parahnas[ind] != parahnas[ind + 1]:
				index = ind + 1
		print(index)


def lis():
	return [int(x) for x in input().split()]

def intt():
	return int(input())

def st():
	return str(input())
t = intt()
for i in range(t):
	n = intt()
	a = lis()
	s = set(a)
	if len(s) == 1:
		print(-1)
	else:
		maxx = max(s)
		count = a.count(maxx)
		if a[0] == maxx and a[1] < maxx:
			print(1)
		elif a[-1] == maxx and a[-2] < maxx:
			print(n)
		else:
			for j in range(1, n - 1):
				if (a[j - 1] < maxx or a[j + 1] < maxx) and a[j] == maxx:
					print(j + 1)
					break


import sys
import math

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	a = get_array()
	flag = 0
	ans = 0
	m = max(a)
	for i in range(n):
		if a[i] == m:
			if i + 1 < n:
				if a[i + 1] < a[i]:
					flag = 1
					ans = i
					break
			if i - 1 >= 0:
				if a[i - 1] < a[i]:
					flag = 1
					ans = i
					break
	if flag == 1:
		print(ans + 1)
	else:
		print(-1)


def inp():
	return int(input())

def inl():
	return [int(i) for i in input().split()]
p = inp()
for _ in range(p):
	n = inp()
	x = inl()
	max_item = max(x)
	cnt = -1
	for i in range(n):
		if x[i] == max_item:
			if i < n - 1 and x[i + 1] < max_item:
				cnt = i + 1
				break
			elif i > 0 and x[i - 1] < max_item:
				cnt = i + 1
				break
	print(cnt)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	m = l[0]
	ind = 1
	flag = 0
	for i in range(len(l)):
		if l[i] != m:
			flag = 1
		if l[i] > m:
			m = max(m, l[i])
			ind = i + 1
		if l[i] < m and i != 0 and (l[i - 1] == m):
			ind = i
	if flag == 0:
		print(-1)
	else:
		print(ind)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
readint = lambda : int(sys.stdin.readline().rstrip('\r\n'))
readints = lambda : map(int, sys.stdin.readline().rstrip('\r\n').split())
readstr = lambda : sys.stdin.readline().rstrip('\r\n')
readstrs = lambda : map(str, sys.stdin.readline().rstrip('\r\n').split())
readarri = lambda : [int(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]
readarrs = lambda : [str(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]

def main():
	for _ in range(readint()):
		n = readint()
		arr = readarri()
		mx = max(arr)
		if len(set(arr)) == 1:
			print(-1)
		else:
			for i in range(len(arr)):
				if i == 0:
					if arr[i] == mx:
						if arr[i] > arr[i + 1]:
							print(i + 1)
							break
				elif i == n - 1:
					if arr[i] == mx:
						if arr[i] > arr[i - 1]:
							print(i + 1)
							break
				elif arr[i] == mx:
					if arr[i] > arr[i - 1] or arr[i] > arr[i + 1]:
						print(i + 1)
						break
main()


t = int(input())
for i in range(t):
	n = int(input())
	l1 = input().split()
	l = [int(i1) for i1 in l1]
	m = max(l)
	ip = l.index(m)
	k = -1
	if ip > 0:
		k = ip + 1
	else:
		while ip != len(l) - 1:
			if l[ip + 1] == l[ip]:
				ip = ip + 1
			elif l[ip + 1] < l[ip]:
				k = ip + 1
				break
	print(k)


from sys import stdin, stdout
import math, bisect
from collections import Counter, deque, defaultdict
L = lambda : list(map(int, stdin.readline().strip().split()))
M = lambda : map(int, stdin.readline().strip().split())
I = lambda : int(stdin.readline().strip())
S = lambda : stdin.readline().strip()
C = lambda : stdin.readline().strip().split()

def pr(a):
	return ''.join(list(map(str, a)))

def solve():
	n = I()
	a = L()
	x = max(a)
	if a.count(x) == n:
		print(-1)
	else:
		for i in range(1, n):
			if a[i] == x and a[i] > a[i - 1]:
				print(i + 1)
				break
			elif a[i - 1] == x and a[i] < a[i - 1]:
				print(i)
				break
for _ in range(I()):
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	if len(set(a)) == 1:
		print(-1)
	else:
		maxi = 0
		maxel = a[0]
		colmax = 1
		for i in range(1, n):
			if maxel < a[i]:
				maxel = a[i]
				maxi = i
				colmax = 1
			elif maxel == a[i]:
				colmax += 1
		if colmax > 1:
			maxi = -2
			for i1 in range(1, n):
				if a[i1] == maxel and a[i1 - 1] < maxel:
					maxi = i1
					break
			for i1 in range(n - 1):
				if a[i1] == maxel and a[i1 + 1] < maxel:
					maxi = i1
					break
		print(maxi + 1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	ml = []
	for i in range(n):
		if l[i] == m:
			ml.append(i)
	ans = -1
	if ml[0] != 0:
		ans = ml[0] + 1
	else:
		for i in ml:
			if i != n - 1 and l[i] != l[i + 1]:
				ans = i + 1
				break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split()]
	maxi = max(arr)
	max_ind = [i for (i, val) in enumerate(arr) if val == maxi]
	if len(max_ind) == n:
		print(-1)
		continue
	for i in max_ind:
		if i != n - 1:
			if arr[i + 1] < arr[i]:
				print(i + 1)
				break
		if i != 0:
			if arr[i - 1] < arr[i]:
				print(i + 1)
				break
	else:
		print(-1)


import sys
import math
from math import *
from collections import Counter, defaultdict, deque
from bisect import bisect
lip = lambda : list(map(int, input().split()))
ip = lambda : int(input())
sip = lambda : input().split()
mod = 10 ** 9 + 7

def main():
	n = ip()
	arr = lip()
	mx = max(arr)
	for i in range(n):
		if mx == arr[i]:
			if i == 0:
				if arr[i] > arr[i + 1]:
					print(i + 1)
					return
			elif i == n - 1:
				if arr[i] > arr[i - 1]:
					print(i + 1)
					return
			elif arr[i - 1] < arr[i] or arr[i] > arr[i + 1]:
				print(i + 1)
				return
	print(-1)
for i in range(ip()):
	main()


for i in range(int(input())):
	input()
	alef = list(map(int, input().split()))
	alefMn = set(alef)
	if len(alefMn) == 1:
		print(-1)
		continue
	index = 0
	for i in range(len(alef)):
		if i != 0 and i != len(alef) - 1:
			if alef[i] > alef[i - 1] or alef[i] > alef[i + 1]:
				if index == 0:
					index = i + 1
				elif alef[index - 1] < alef[i]:
					index = i + 1
		if i == 0:
			if alef[i] > alef[i + 1]:
				index = 1
		if i == len(alef) - 1:
			if alef[i] > alef[i - 1]:
				if index == 0:
					index = i + 1
				elif alef[index - 1] < alef[i]:
					index = i + 1
	print(index)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	check = False
	m = max(arr)
	for i in range(n):
		if i == 0 and arr[0] == m:
			if arr[i + 1] < m:
				print(i + 1)
				check = True
				break
		elif i == n - 1 and arr[-1] == m:
			if arr[i - 1] < m:
				print(i + 1)
				check = True
				break
		elif arr[i] == m:
			if arr[i - 1] < m:
				print(i + 1)
				check = True
				break
			elif arr[i + 1] < m:
				print(i + 1)
				check = True
				break
			else:
				continue
	if check == False:
		print(-1)


t = int(input())
for i in range(t):
	n = int(input())
	v = input()
	v = v.split()
	v = [int(i) for i in v]
	maxi = max(v)
	okay = True
	if v[0] == maxi and v[0] > v[1]:
		print(1)
		okay = False
	if v[len(v) - 1] == maxi and maxi > v[len(v) - 2]:
		if okay:
			print(len(v))
			okay = False
	for i in range(1, len(v) - 1):
		if v[i] == maxi and (v[i - 1] < maxi or v[i + 1] < maxi) and okay:
			print(i + 1)
			okay = False
			break
	if okay:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) == 1:
		print(-1)
		continue
	else:
		k = max(a)
		for i in range(n):
			if a[i] == k:
				if i != 0 and i != n - 1:
					if a[i] != a[i - 1] or a[i + 1] != a[i]:
						ans = i + 1
						break
				elif i == 0:
					if a[i] != a[i + 1]:
						ans = 1
						break
				elif i == n - 1:
					if a[i] != a[i - 1]:
						ans = n
						break
			else:
				pass
		print(ans)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(list(set(a))) == 1:
		print(-1)
	else:
		max1 = max(a)
		for i in range(len(a)):
			if a[i] == max1:
				if i > 0 and a[i - 1] < max1:
					print(i + 1)
					break
				elif i < n - 1 and a[i + 1] < max1:
					print(i + 1)
					break


def rl():
	return list(map(int, input().split()))

def arp(arr):
	return ' '.join([str(i) for i in arr])
from collections import deque, Counter
from math import ceil, sqrt, log2, log, floor
for _ in range(int(input())):
	(n,) = rl()
	arr = rl()
	if len(set(arr)) == 1:
		print(-1)
	else:
		m = max(arr)
		for i in range(1, n):
			if arr[i - 1] != arr[i]:
				if arr[i - 1] == m or arr[i] == m:
					if arr[i - 1] == m:
						print(i)
						break
					else:
						print(i + 1)
						break


t = int(input())
for q in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	x = l.count(m)
	if x == n:
		print(-1)
	elif x == 1:
		print(l.index(m) + 1)
	else:
		id = l.index(m)
		if id == 0:
			i = id
			while i < n and l[i] == m:
				i += 1
			print(i)
		else:
			print(id + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	s = 0
	q = 0
	if len(set(a)) == 1:
		print(-1)
	else:
		for i in range(len(a)):
			if s < a[i]:
				q = i
				s = a[i]
		if q != 0:
			print(q + 1)
		else:
			while a[q] == a[q + 1]:
				q += 1
			print(q + 1)


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	u = max(a)
	x = 0
	for i in range(n):
		if a[i] == u:
			if i != n - 1 and a[i + 1] < a[i]:
				x = 1
				print(i + 1)
				break
			if a[i - 1] < a[i] and i != 0:
				x = 1
				print(i + 1)
				break
	if x == 0:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	k = max(l)
	f = 0
	for i in range(n):
		if l[i] != k:
			f = 1
			break
	if f == 1:
		z = -1
		for i in range(n):
			if l[i] == k:
				j = i
				while j <= n - 1:
					if l[j] != k:
						z = j - 1
						break
					j += 1
				if z == -1:
					j = i
					while j > -1:
						if l[j] != k:
							z = j + 1
							break
						j -= 1
			if z != -1:
				break
		print(z + 1)
	else:
		print(-1)


for t in range(int(input())):
	k = int(input())
	ntc = list(map(int, input().split()))
	max_inp = max(ntc)
	if len(set(ntc)) == 1:
		print(-1)
	elif max(ntc) == ntc[0]:
		if ntc[0] != ntc[1]:
			print(1)
		else:
			for i in range(k):
				if ntc[i] != ntc[0]:
					print(i)
					break
	else:
		print(ntc.index(max(ntc)) + 1)


for _ in range(int(input())):
	n = int(input())
	lene = list(map(int, input().split()))
	if len(set(lene)) == 1:
		print(-1)
	else:
		lene.append(-1)
		j = n
		if lene[0] > lene[1]:
			j = 0
		if lene[n - 1] > lene[n - 2] and lene[n - 1] > lene[j]:
			j = n - 1
		for i in range(1, n - 1):
			if lene[i] > lene[j]:
				if lene[i] > lene[i + 1] or lene[i] > lene[i - 1]:
					j = i
		print(j + 1)


t = int(input())
while t:
	n = int(input())
	nl = list(map(int, input().split()))
	maxi = max(nl)
	ind = nl.index(maxi)
	ans = ind + 1
	if ind == 0:
		if len(set(nl)) == 1:
			ans = -1
		else:
			while 1:
				if nl[ind + 1] == maxi:
					ind += 1
				else:
					ans = ind + 1
					break
	print(ans)
	t -= 1


t = int(input())
for q in range(t):
	n = int(input())
	a = [int(z) for z in input().split()]
	m = max(a)
	p = True
	for i in range(n):
		if a[i] == m:
			if i == 0:
				if a[i + 1] < a[i]:
					print(i + 1)
					p = False
					break
			elif i == n - 1:
				if a[i - 1] < a[i]:
					print(i + 1)
					p = False
					break
			elif a[i - 1] < a[i] or a[i + 1] < a[i]:
				print(i + 1)
				p = False
				break
			else:
				continue
	if p:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	l = max(a)
	c = a.count(l)
	if n == c:
		print(-1)
	else:
		ind = a.index(l)
		f = 1
		for i in range(ind, n):
			if a[i] < l:
				ind = i
				f = 0
				break
			elif a[i - 1] < l and i != 0:
				ind = i + 1
				break
		print(ind)


for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if arr.count(arr[0]) == n:
		print('-1')
	else:
		x = arr.index(max(arr))
		y = x
		while 1:
			if x + 1 == n:
				break
			elif arr[x] == arr[x + 1]:
				x += 1
			else:
				break
		if x + 1 == n and x != y:
			print(y + 1)
		else:
			print(x + 1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(-1)
		continue
	a = max(l)
	b = l.index(a)
	j = b + 1
	while j < n and l[j] == l[b]:
		j += 1
	if j == n and l[j - 1] == l[b]:
		j = b + 1
	print(j)


t = int(input())
while t:
	t -= 1
	res = -1
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	if l[0] == m and l[1] < m:
		print(1)
	elif l[-1] == m and l[-2] < m:
		print(n)
	else:
		for i in range(1, n - 1):
			if l[i] == m and (l[i + 1] < m or l[i - 1] < m):
				res = i + 1
				break
		print(res)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	ind = []
	_max = start = -1
	for i in range(0, len(a) - 1):
		if a[i] > a[i + 1] and a[i] > _max:
			_max = a[i]
			start = i
	for i in range(len(a) - 1, 0, -1):
		if a[i] > a[i - 1] and a[i] > _max:
			_max = a[i]
			start = i
	if start == -1:
		print('-1')
	else:
		print(start + 1)


for _ in range(int(input())):
	n = int(input())
	piranha = list(map(int, input().split()))
	if piranha.count(piranha[0]) == len(piranha):
		print(-1)
		continue
	x = max(piranha)
	if piranha.count(x) == 1:
		print(piranha.index(x) + 1)
	else:
		ans = None
		for i in range(n):
			if piranha[i] != x:
				continue
			if i == 0:
				if piranha[1] != x:
					ans = 1
					break
				continue
			if i == n - 1:
				if piranha[n - 2] != x:
					ans = n
					break
				continue
			elif piranha[i - 1] != x or piranha[i + 1] != x:
				ans = i + 1
				break
		print(ans)


from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	m = max(a)
	res = -1
	for (idx, val) in enumerate(a):
		if val == m:
			if idx > 0 and val > a[idx - 1]:
				res = idx + 1
				break
			if idx < n - 1 and val > a[idx + 1]:
				res = idx + 1
				break
	print(res)


import re

def readGenerator():
	while True:
		tokens = input().split(' ')
		for t in tokens:
			yield t
reader = readGenerator()

def readWord():
	return next(reader)

def readInt():
	return int(next(reader))

def readFloat():
	return float(next(reader))

def readLine():
	return input()

def solve(a, n):
	m = max(a)
	for i in range(0, n):
		if a[i] == m and (i > 0 and a[i - 1] != m or (i < n - 1 and a[i + 1] != m)):
			return i + 1
	return -1
t = readInt()
for _ in range(t):
	n = readInt()
	a = [readInt() for _ in range(n)]
	print(solve(a, n))


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	index = 0
	m = a[0] if a[0] > a[1] else -1
	for i in range(1, n - 1):
		if (a[i] > a[i - 1] or a[i] > a[i + 1]) and a[i] > m:
			index = i
			m = a[i]
	if a[n - 1] > m and a[n - 1] > a[n - 2]:
		m = a[n - 1]
		index = n - 1
	print(index + 1 if m >= 0 else -1)


t = int(input())
for _ in range(t):
	n = int(input())
	(*a,) = map(int, input().split())
	if len(set(a)) == 1:
		print(-1)
		continue
	mx = max(a)
	fin = False
	for i in range(n):
		if a[i] == mx:
			if i and a[i - 1] < a[i]:
				print(i + 1)
				fin = True
				break
			if i < n - 1 and a[i] > a[i + 1]:
				print(i + 1)
				fin = True
				break
		if fin:
			break


t = int(input())
for i in range(t):
	size = int(input())
	aqua = list(input().split(' '))
	aquarium = []
	for x in aqua:
		aquarium.append(int(x))
	a = aquarium.index(max(aquarium))
	b = a
	while b < size - 1:
		if aquarium[b] > aquarium[b + 1]:
			print(b + 1)
			b = size + 1
			break
		else:
			b += 1
	if b == size - 1:
		b = a
		while b > 0:
			if aquarium[b] > aquarium[b - 1]:
				print(b + 1)
				b = -100
				break
			else:
				b -= 1
	if b == 0:
		print('-1')


import sys, bisect, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby
rep = range
R = range

def Golf():
	(n, *t) = map(int, open(0).read().split())

def I():
	return int(input())

def S_():
	return input()

def IS():
	return input().split()

def LS():
	return [i for i in input().split()]

def MI():
	return map(int, input().split())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def NLI(n):
	return [[int(i) for i in input().split()] for i in range(n)]

def NLI_(n):
	return [[int(i) - 1 for i in input().split()] for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def RA():
	return map(int, open(0).read().split())

def RLI(n=8, a=1, b=10):
	return [random.randint(a, b) for i in range(n)]

def RI(a=1, b=10):
	return random.randint(a, b)

def INP():
	N = 10
	A = 10
	n = random.randint(1, N)
	a = [random.randint(1, A) for i in range(n)]
	return (n, a)

def Rtest(T):
	(case, err) = (0, 0)
	for i in range(T):
		inp = INP()
		a1 = naive(*inp)
		a2 = solve(*inp)
		if a1 != a2:
			print((a1, a2), inp)
			err += 1
		case += 1
	print('Tested', case, 'case with', err, 'errors')

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in range(V)]
	FromStdin = True if ls == None else False
	for i in range(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = (a, c)
		bb = (b, c)
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in R(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def accum(ls):
	rt = [0]
	for i in ls:
		rt += [rt[-1] + i]
	return rt

def bit_combination(n, base=2):
	rt = []
	for tb in R(base ** n):
		s = [tb // base ** bt % base for bt in R(n)]
		rt += [s]
	return rt

def gcd(x, y):
	if y == 0:
		return x
	if x % y == 0:
		return y
	while x % y != 0:
		(x, y) = (y, x % y)
	return y

def YN(x):
	print(['NO', 'YES'][x])

def Yn(x):
	print(['No', 'Yes'][x])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(-1, 0), (1, 0), (0, 1), (0, -1)]
EightNb = [(-1, 0), (1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('WENS', FourNb))
cursol = dict(zip('LRUD', FourNb))
l_alp = string.ascii_lowercase
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
input = lambda : sys.stdin.readline().rstrip()
show_flg = False
show_flg = True
ans = 0
for _ in range(I()):
	ans = 0
	n = I()
	a = LI()
	M = max(a)
	m = min(a)
	for i in range(n - 1):
		if a[i] == M and a[i + 1] < M:
			ans = i + 1
	for i in range(n - 1, 0, -1):
		if a[i] == M and a[i - 1] < M:
			ans = i + 1
	if M == m:
		ans = -1
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	sizes = list(map(int, input().split()))
	if len(set(sizes)) == 1:
		print(-1)
	else:
		mx = max(sizes)
		if sizes[0] == mx:
			for i in range(n):
				if sizes[i] != mx:
					print(i)
					break
		else:
			for i in range(n):
				if sizes[i] == mx:
					print(i + 1)
					break


import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for _ in range(int(input())):
	n = int(input())
	a = [*map(int, input().split())]
	am = max(a)
	c1 = sum((i != am for i in a))
	if c1 == 0:
		print(-1)
	elif a[0] == am and a[1] != am:
		print(1)
	elif a[-1] == am and a[-2] != am:
		print(n)
	else:
		for i in range(1, n - 1):
			if a[i] == am and (a[i - 1] != am or a[i + 1] != am):
				print(i + 1)
				break


import math
import sys
import collections
import bisect
input = sys.stdin.readline
flush = sys.stdout.flush
readint = lambda : int(input())
readintm = lambda : map(int, input().strip().split())
readintl = lambda : list(map(int, input().strip().split()))
readfloatm = lambda : map(float, input().strip().split())
readfloatl = lambda : list(map(float, input().strip().split()))
readstr = lambda : input().strip()
readstrl = lambda : list(input().strip())
join = lambda x, l: x.join(map(str, l))
print = lambda *x: sys.stdout.write(' '.join(map(str, x)) + '\n')
printl = lambda l: sys.stdout.write(' '.join(map(str, l)) + '\n')
ceil = lambda x, y: (x + y - 1) // y
mod = 1000000007

def test(nums, i, num):
	l = i - 1
	r = i + 1
	while l >= 0 or r < len(nums):
		if l >= 0 and nums[l] < num:
			l -= 1
			num += 1
		elif r < len(nums) and nums[r] < num:
			r += 1
			num += 1
		else:
			return False
	return True
for _ in range(readint()):
	n = readint()
	nums = readintl()
	high = max(nums)
	for (i, num) in enumerate(nums):
		if num == high and test(nums, i, num):
			print(i + 1)
			break
	else:
		print(-1)


import math
import string
import random
from random import randrange
from collections import deque
from collections import defaultdict

def solve(n, arr):
	ans = 0
	if max(arr) == min(arr):
		print(-1)
		return
	k = max(arr)
	if arr[0] == k and arr[0] > arr[1]:
		print(1)
		return
	if arr[-1] == k and arr[-1] > arr[-2]:
		print(n)
		return
	for i in range(1, n - 1):
		if arr[i] == k and (arr[i] > arr[i - 1] or arr[i] > arr[i + 1]):
			print(i + 1)
			return
	print(-1)
	return

def main():
	t = int(input())
	while t > 0:
		t -= 1
		n = int(input())
		arr = list(map(int, input().strip().split(' ')))
		solve(n, arr)
	return

def test():
	arr_size = 25
	test_cases = 100
	min_range = -100
	max_range = 100
	str_size = 30
	step = 1
	for i in range(test_cases):
		k = []
		for j in range(arr_size):
			num = randrange(min_range, max_range, step)
			k.append(num)
		solve(n, arr)
		print('<-------- DEBUG ----------->')
	return
main()


import string
loopnumber = int(input())
while loopnumber > 0:
	piranas = int(input())
	a = list(map(int, input().split()))
	m = 0
	flag = 0
	temp = a[0]
	for i in range(0, piranas):
		if a[i] != temp:
			flag = 1
		if a[i] > m:
			if i == 0:
				if a[1] < a[0]:
					m = a[i]
					index = i
			elif i == piranas - 1:
				if a[piranas - 2] < a[piranas - 1]:
					m = [i]
					index = i
			elif a[i - 1] < a[i] or a[i + 1] < a[i]:
				m = a[i]
				index = i
	if flag == 1:
		print(index + 1)
	else:
		print('-1')
	loopnumber -= 1


for i in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	mx = max(lst)
	mn = min(lst)
	if mx == mn:
		print(-1)
	else:
		idx = -1
		if lst[0] == mx and lst[1] != mx:
			idx = 0
			print(idx + 1)
			continue
		else:
			for j in range(1, len(lst) - 1):
				if lst[j] == mx and (lst[j + 1] != mx or lst[j - 1] != mx):
					idx = j
					break
			else:
				idx = len(lst) - 1
			print(idx + 1)


import sys, os
from sys import stdin as sysstdin
t = int(sysstdin.readline().strip())
for _ in range(0, int(t)):
	n = int(sysstdin.readline().strip())
	a = [int(x) for x in sysstdin.readline().split()]
	m = max(a)
	idx = [i for (i, j) in enumerate(a) if j == m]
	if len(idx) == n:
		print(-1)
		continue
	for (i, ind) in enumerate(idx):
		if ind == 0:
			if a[ind + 1] != m:
				print(ind + 1)
				break
		elif ind == n - 1:
			if a[ind - 1] != m:
				print(ind + 1)
				break
		elif a[ind - 1] != m or a[ind + 1] != m:
			print(ind + 1)
			break


T = int(input())
for t in range(T):
	n = int(input())
	x = [int(i) for i in input().split()]
	m = max(x)
	a = len(list(set(x)))
	ans = -1
	if a <= 1:
		print(-1)
	else:
		for i in range(n - 1):
			if x[i] == m and x[i + 1] < m:
				ans = i
		if ans == -1:
			for i in range(1, n):
				if x[i] == m and x[i - 1] < m:
					ans = i
		print(ans + 1)


def mi():
	return map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	m = max(arr)
	if arr.count(m) == n:
		print(-1)
	else:
		i = 0
		while i < n:
			if arr[i] == m:
				if i == 0:
					if arr[i + 1] != m:
						print(i + 1)
						break
				elif i == n - 1:
					if arr[i - 1] != m:
						print(i + 1)
						break
				elif arr[i - 1] != m or arr[i + 1] != m:
					print(i + 1)
					break
			i += 1


T = int(input())
for _ in range(0, T):
	n = int(input())
	s = [int(x) for x in input().split()]
	if len(set(s)) == 1:
		print(-1)
	else:
		mx = max(s)
		ptr = 1
		for i in range(0, len(s)):
			if s[i] == mx:
				flag = 0
				if i - 1 >= 0 and s[i - 1] != mx:
					flag = 1
				if i + 1 < n and s[i + 1] != mx:
					flag = 1
				if flag == 1:
					ptr = i + 1
		print(ptr)


for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	if len(set(s)) == 1:
		print(-1)
	else:
		qq = max(s)
		for i in range(n):
			f = 0
			if i and s[i - 1] < s[i]:
				f = 1
			if i + 1 < n and s[i + 1] < s[i]:
				f = 1
			if f and s[i] == qq:
				print(i + 1)
				break


t = int(input())

def dominant(piranhas, n):
	m = max(piranhas)
	for j in range(n):
		if piranhas[j] == m:
			if j - 1 >= 0 and piranhas[j - 1] < m:
				return j + 1
			if j + 1 < n and piranhas[j + 1] < m:
				return j + 1
	return -1
for i in range(t):
	n = int(input())
	piranhas = list(map(int, input().split()))
	print(dominant(piranhas, n))


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	x = a[0]
	cnt = 0
	ans = -10000000000.0
	for i in range(n):
		if a[i] == x:
			cnt += 1
		ans = max(ans, a[i])
	if cnt == n:
		print(-1)
	else:
		ok = False
		for i in range(1, n):
			if a[i] == ans and a[i - 1] != ans:
				ok = True
				print(i + 1)
				break
		if not ok:
			for i in range(n - 1):
				if a[i] == ans and a[i + 1] != ans:
					print(i + 1)
					break


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
	else:
		mx = max(a)
		ind = -1
		if a[0] == mx and a[0] > a[1]:
			ind = 1
		if a[-1] == mx and a[-1] > a[-2]:
			ind = n
		for i in range(1, n - 1):
			if a[i] > a[i - 1] or a[i] > a[i + 1]:
				if a[i] == mx:
					ind = i + 1
		print(ind)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	m = max(arr)
	if len(set(arr)) == 1:
		print(-1)
	else:
		for i in range(n):
			if i == 0:
				if arr[i] == m:
					if arr[i] > arr[i + 1]:
						print(i + 1)
						break
			elif i == n - 1:
				if arr[i] == m:
					if arr[i] > arr[i - 1]:
						print(i + 1)
						break
			elif arr[i] == m:
				if arr[i] > arr[i - 1] or arr[i] > arr[i + 1]:
					print(i + 1)
					break


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	f = True
	for i in range(n - 1):
		if arr[i] != arr[i + 1]:
			f = False
	if f == True:
		print(-1)
	else:
		mex = max(arr)
		pos = -1
		for i in range(n):
			if arr[i] == mex:
				if i - 1 >= 0 and arr[i - 1] != mex:
					pos = i
				if i + 1 < n and arr[i + 1] != mex:
					pos = i
		print(pos + 1)


numCases = int(input())
for i in range(0, numCases):
	numPiranhas = int(input())
	piranhas = str(input())
	piranhas = [int(n) for n in piranhas.split()]
	index = -1
	maximum = max(piranhas)
	for j in range(0, numPiranhas - 1):
		if piranhas[j] == maximum:
			if piranhas[j] > piranhas[j + 1]:
				index = j + 1
			elif piranhas[j] < piranhas[j + 1]:
				index = j + 2
			if j >= 1:
				if piranhas[j - 1] < piranhas[j]:
					index = j + 1
		elif piranhas[j + 1] == maximum:
			if piranhas[j] < piranhas[j + 1]:
				index = j + 2
	print(index)


from collections import defaultdict as dd, deque as dq, Counter as c
from math import factorial as f, ceil, gcd, sqrt
for _ in range(int(input())):
	a = int(input())
	b = list(map(int, input().split()))
	t = max(b)
	if [t] * a == b:
		print(-1)
	else:
		ans = None
		for i in range(1, len(b)):
			if b[i] == t and (b[i] > b[i - 1] or b[i] > b[i + 1]):
				ans = i + 1
				break
		if ans != None:
			print(ans)
		elif b[0] == t and b[0] > b[1]:
			print(1)
		elif b[-1] == t and b[-1] > b[-2]:
			print(a)
		else:
			print(-1)


from queue import Queue
t = int(input())
for _ in range(t):
	kek = int(input())
	piras = list(map(int, input().split()))
	if len(set(piras)) <= 1:
		print('-1')
		continue
	jo = max(piras)
	end = None
	for (indx, pira) in enumerate(piras):
		if pira == jo:
			if indx - 1 >= 0 and piras[indx - 1] < pira:
				end = indx
				break
			if indx + 1 < len(piras) and piras[indx + 1] < pira:
				end = indx
				break
	print(indx + 1)


import sys

def read(func=int):
	return func(sys.stdin.readline().strip())

def readList(func=int):
	return list(map(func, sys.stdin.readline().strip().split()))
t = read()
for _ in range(t):
	n = read()
	A = readList()
	a = -1
	maxi = max(A)
	for i in range(n):
		prev = maxi
		post = maxi
		if i > 0:
			prev = A[i - 1]
		if i < n - 1:
			post = A[i + 1]
		if A[i] == maxi and (prev != maxi or post != maxi):
			a = i + 1
			break
	print(a)


def lis():
	return list(map(int, input().split()))
for _ in range(int(input())):
	y = int(input())
	x = lis()
	y1 = set(x)
	z = list(y1)
	if len(z) == 1:
		print(-1)
	else:
		w = 0
		q1 = max(x)
		for i in range(y):
			if x[i] == q1:
				if i - 1 >= 0 and x[i - 1] != q1:
					w = i + 1
					break
				elif i + 1 < y and x[i + 1] != q1:
					w = i + 1
					break
		if w == 0:
			print(-1)
		else:
			print(w)


from collections import *
from itertools import *
from bisect import *

def inp():
	return int(input())

def arrinp():
	return [int(x) for x in input().split()]

def main():
	t = inp()
	for _ in range(t):
		n = inp()
		A = arrinp()
		check = set(A)
		if len(check) == 1:
			print(-1)
			continue
		ele = max(A)
		ans = 0
		for i in range(len(A)):
			if A[i] == ele:
				if i == 0:
					if A[i + 1] != ele:
						ans = i
						break
				elif i == n - 1:
					if A[i - 1] != ele:
						ans = i
						break
				elif A[i + 1] != ele or A[i - 1] != ele:
					ans = i
					break
		print(ans + 1)
main()


for o in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	a = max(s)
	p = -1
	for i in range(n):
		if i - 1 >= 0:
			if s[i] == a and s[i - 1] < a:
				p = i + 1
				break
		if i + 1 < n:
			if s[i] == a and s[i + 1] < a:
				p = i + 1
				break
	print(p)


def solve(n, a):
	peak_ind = None
	peak_val = 0
	if a[0] > a[1]:
		peak_ind = 0
		peak_val = a[0]
	if a[n - 1] > a[n - 2] and a[n - 1] > peak_val:
		peak_ind = n - 1
		peak_val = a[n - 1]
	for i in range(1, n - 1):
		if a[i - 1] <= a[i] >= a[i + 1] and (a[i] > a[i - 1] or a[i] > a[i + 1]):
			if a[i] > peak_val:
				peak_ind = i
				peak_val = a[i]
	if peak_ind != None:
		return peak_ind + 1
	else:
		return -1
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	print(solve(n, a))


t = int(input())
for i in range(0, t):
	m = int(input())
	arr = list(map(int, input().strip().split()))[:m]
	y = max(arr)
	l = []
	for j in range(0, m):
		if y == arr[j]:
			l.append(j)
	z = len(l)
	if z == m:
		ans = -1
	elif l[0] != 0:
		ans = l[0]
	elif l[0] == 0:
		k = 0
		while y == arr[k]:
			k += 1
		k -= 1
		ans = k
	elif l[-1] != m - 1:
		ans = l[-1]
	elif l[-1] == m - 1:
		k = 0
		while y == arr[k]:
			k += 1
		k -= 1
		ans = k
	if ans != -1:
		ans = ans + 1
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	if len(set(arr)) == 1:
		print(-1)
		continue
	m = max(arr)
	for i in range(n):
		if i == 0:
			if arr[i] == m and arr[i + 1] < m:
				print(i + 1)
				break
		elif i == n - 1:
			if arr[i] == m and arr[i - 1] < m:
				print(i + 1)
				break
		elif arr[i] == m and (arr[i + 1] < m or arr[i - 1] < m):
			print(i + 1)
			break


t = int(input())
for ti in range(t):
	n = int(input())
	li = [int(i) for i in input().split()]
	m = max(li)
	if li.count(m) == len(li):
		print(-1)
	else:
		for (p, i) in enumerate(li):
			if i == m:
				if p > 0:
					if li[p - 1] < i:
						print(p + 1)
						break
				if p < n - 1:
					if li[p + 1] < i:
						print(p + 1)
						break


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	s = max(a)
	f = 0
	for i in range(n):
		if a[i] == s:
			if i == 0:
				if a[i] > a[i + 1]:
					print(i + 1)
					f = 1
					break
			elif i > 0 and i < n - 1:
				if a[i] > a[i + 1] or a[i] > a[i - 1]:
					print(i + 1)
					f = 1
					break
			elif a[i] > a[i - 1]:
				print(i + 1)
				f = 1
				break
	if f == 0:
		print(-1)


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	z = -1
	for i in range(n):
		if a[i] == m:
			if i - 1 >= 0 and a[i] > a[i - 1]:
				z = i + 1
				break
			if i + 1 < n and a[i] > a[i + 1]:
				z = i + 1
				break
	return z
t = int(input())
i = 0
while i < t:
	print(solve())
	i += 1


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	ans = -1
	mx = max(a)
	for j in range(n):
		if a[j] == mx and (j > 0 and a[j] > a[j - 1] or (j < n - 1 and a[j] > a[j + 1])):
			ans = j + 1
			break
	print(ans)


from sys import stdin, stdout

def INI():
	return int(stdin.readline())

def INL():
	return [int(_) for _ in stdin.readline().split()]

def INS():
	return stdin.readline()

def OPS(ans):
	stdout.write(str(ans) + '\n')

def OPL(ans):
	[stdout.write(str(_) + ' ') for _ in ans]
	stdout.write('\n')
for _ in range(INI()):
	n = INI()
	A = INL()
	if [A[0] for _ in range(n)] == A:
		print(-1)
	else:
		m = max(A)
		for _ in range(n):
			if _ == 0:
				if A[_] == m and A[_] > A[_ + 1]:
					OPS(_ + 1)
					break
			elif _ == n - 1:
				if A[_] == m and A[_] > A[_ - 1]:
					OPS(_ + 1)
					break
			elif A[_] == m and (A[_ - 1] < A[_] or A[_] > A[_ + 1]):
				OPS(_ + 1)
				break


from math import *
sInt = lambda : int(input())
mInt = lambda : map(int, input().split())
lInt = lambda : list(map(int, input().split()))
t = sInt()
for _ in range(t):
	n = sInt()
	a = lInt()
	if max(a) == min(a):
		print(-1)
	else:
		max_ = max(a)
		for (i, al) in enumerate(a):
			if al != max_:
				continue
			if i == 0:
				if a[i] > a[i + 1]:
					print(i + 1)
					break
			elif i == n - 1:
				if a[i] > a[i - 1]:
					print(i + 1)
					break
			elif a[i] > a[i - 1] or a[i] > a[i + 1]:
				print(i + 1)
				break


from sys import stdin
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	if len(set(a)) == 1:
		print(-1)
		continue
	m = max(a)
	a = [m] + a + [m]
	i = 1
	while a[i] != m or (a[i - 1] == m and a[i + 1] == m):
		i += 1
	print(i)


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	maximum = max(a)
	minimum = min(a)
	if maximum == minimum:
		print(-1)
	else:
		for ind in range(n):
			if ind == 0:
				if a[ind] > a[ind + 1] and a[ind] == maximum:
					print(ind + 1)
					break
			elif ind == n - 1:
				if a[ind] > a[ind - 1] and a[ind] == maximum:
					print(ind + 1)
					break
			elif (a[ind] > a[ind - 1] or a[ind] > a[ind + 1]) and a[ind] == maximum:
				print(ind + 1)
				break


import sys
import collections
input = sys.stdin.readline
T = int(input())
for case in range(T):
	N = int(input())
	a = [int(x) for x in input().split()]
	if N == 1:
		print(1)
		continue
	mx = max(a)
	all = True
	small = [False] * N
	for i in range(N):
		if a[i] != mx:
			small[i] = True
			all = False
	if all:
		print(-1)
	else:
		for i in range(N):
			if i == 0:
				if a[i] == mx and small[i + 1]:
					print(i + 1)
					break
			elif i == N - 1:
				if a[i] == mx and small[i - 1]:
					print(i + 1)
					break
			elif a[i] == mx and (small[i - 1] or small[i + 1]):
				print(i + 1)
				break


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print(-1)
	else:
		flag = 0
		mex = max(arr)
		for i in range(n):
			if arr[i] == mex:
				if i != n - 1:
					if arr[i + 1] < mex:
						print(i + 1)
						flag = 1
						break
				if i != 0:
					if arr[i - 1] < mex:
						print(i + 1)
						flag = 1
						break
		if flag == 0:
			print(-1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if a.count(a[0]) == n:
		print(-1)
	else:
		idx = a.index(max(a))
		if idx != 0:
			print(idx + 1)
		elif a[idx + 1] != a[idx]:
			print(idx + 1)
		else:
			c = 0
			for z in range(1, n - 1):
				if a[z] == a[idx] and (a[z - 1] != a[idx] or a[z + 1] != a[idx]):
					idx = z
					c = 1
					break
			if c == 1:
				print(idx + 1)
			else:
				print(-1)


def ans(n, arr):
	maxi = -1
	res = -1
	for i in range(n):
		if i - 1 >= 0 and arr[i - 1] < arr[i]:
			if arr[i] > maxi:
				maxi = arr[i]
				res = i
		elif i + 1 < n and arr[i + 1] < arr[i]:
			if arr[i] > maxi:
				maxi = arr[i]
				res = i
	return res + 1 if res != -1 else -1
T = int(input())
for i in range(T):
	n = int(input())
	arr = list(map(int, input().strip().split(' ')))
	print(ans(n, arr))


t = int(input())
for j in range(t):
	printed = False
	n = int(input())
	kalad = [int(x) for x in input().split()]
	maks = max(kalad)
	if kalad.count(maks) == n:
		print('-1')
		continue
	else:
		idx = [index for (index, element) in enumerate(kalad) if element == maks]
		for y in idx:
			if kalad[max(0, y - 1)] < maks or kalad[min(n - 1, y + 1)] < maks:
				if printed == False:
					print(y + 1)
				printed = True
		if printed == False:
			print('-1')


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
for _ in range(ii()):
	n = ii()
	arr = lii()
	a = max(arr)
	i = -1
	for j in range(n):
		if arr[j] == a:
			if j == 0:
				if arr[j + 1] < a:
					i = j + 1
					break
			elif j == n - 1:
				if arr[j - 1] < a:
					i = j + 1
					break
			elif arr[j - 1] < a or arr[j + 1] < a:
				i = j + 1
				break
			else:
				continue
	print(i)


tests = int(input())
for t in range(tests):
	n = input()
	ls = list(map(int, input().split()))
	if len(set(ls)) == 1:
		print(-1)
	else:
		maxi = max(ls)
		prev_maxi = False
		for (idx, item) in enumerate(ls):
			if item == maxi:
				if not prev_maxi and idx != 0:
					print(idx + 1)
					break
				if idx == 0:
					prev_maxi = True
			elif prev_maxi:
				print(idx)
				break


import math
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	x = min(a)
	y = max(a)
	if x == y:
		print(-1)
	else:
		for i in range(n - 1):
			if a[i] != y and a[i + 1] == y:
				print(i + 1 + 1)
				break
			elif a[i] == y and a[i + 1] != y:
				print(i + 1)
				break


for tt in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	b = False
	for i in range(n):
		if i == 0:
			if l[i] == m and l[i + 1] != m:
				print(1)
				b = True
				break
		elif i == n - 1:
			if l[i] == m and l[i - 1] != m:
				print(n)
				b = True
				break
		elif l[i] == m and (l[i - 1] != m or l[i + 1] != m):
			print(i + 1)
			b = True
			break
	if not b:
		print(-1)


T = int(input())
for t in range(T):
	n = int(input())
	piranhas = [int(x) for x in input().split(' ')]
	if all([piranhas[i] == piranhas[i + 1] for i in range(n - 1)]):
		print(-1)
	else:
		dom = max(piranhas)
		for i in range(n - 1):
			if piranhas[i] == dom and piranhas[i + 1] < dom:
				print(i + 1)
				break
			elif piranhas[i] < dom and piranhas[i + 1] == dom:
				print(i + 2)
				break


t = int(input())
for i in range(t):
	n = int(input())
	piranjas = [int(fish_size) for fish_size in input().split()]
	max_size = max(piranjas)
	ans = -1
	for i in range(n - 1):
		if piranjas[i] == max_size:
			if piranjas[i + 1] < max_size:
				ans = i + 1
				break
	if ans != -1:
		print(ans)
		continue
	for i in range(n - 1):
		if piranjas[i + 1] == max_size:
			if piranjas[i] < max_size:
				ans = i + 2
				break
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	lol = [int(n) for n in input().split()]
	if len(list(set(lol))) == 1:
		print(-1)
	else:
		x = max(lol)
		for i in range(len(lol)):
			if i == 0:
				if lol[i] == x and lol[i + 1] < lol[i]:
					print(i + 1)
					break
				else:
					continue
			if i == n - 1:
				if lol[i] == x and lol[i] > lol[i - 1]:
					print(i + 1)
					break
				else:
					continue
			elif lol[i] == x and (lol[i - 1] < x or lol[i + 1] < x):
				print(i + 1)
				break
			else:
				continue


def B(seq):
	seqAux = seq.copy()
	seqAux.sort()
	return seqAux[len(seqAux) - 1]
t = int(input())
for e in range(t):
	n = int(input())
	seq = [int(x) for x in input().split()]
	maior = B(seq)
	resp = -1
	naoentrou = True
	for i in range(n - 1):
		if seq[i] == maior and seq[i + 1] < maior:
			resp = i + 1
			naoentrou = False
			break
	if naoentrou:
		for i in range(n - 1, 0, -1):
			if seq[i] == maior and seq[i - 1] < maior:
				resp = i + 1
				break
	print(resp)


l = []
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		l.append(-1)
	else:
		m = max(a)
		maxind = 0
		for i in range(n):
			if a[i] == m:
				try:
					if a[i - 1] != m and i - 1 >= 0:
						maxind = i
						break
				except:
					None
				try:
					if a[i + 1] != m:
						maxind = i
						break
				except:
					None
		l.append(maxind + 1)
for i in l:
	print(i)


from collections import defaultdict, deque

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	for i in a:
		if i != m:
			break
	else:
		print(-1)
		return None
	for i in range(1, n - 1):
		if a[i] == m and (a[i + 1] != m or a[i - 1] != m):
			print(i + 1)
			return None
	if a[0] == m and a[1] != m:
		print(1)
	else:
		print(n)

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()
main()


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a1 = set(a)
	if len(a1) == 1:
		print(-1)
	else:
		a2 = max(a)
		if a[0] == a2 and a[1] != a2:
			print(1)
		elif a[-1] == a2 and a[-2] != a2:
			print(n)
		else:
			for j in range(1, n - 1):
				if a[j] == a2 and (a[j + 1] != a2 or a[j - 1] != a2):
					print(j + 1)
					break


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = -2
	a = max(arr)
	for i in range(n):
		if i == 0 and arr[i] == a and (arr[i + 1] != arr[i]):
			ans = 0
			break
		elif i == n - 1 and arr[i] == a and (arr[i - 1] != arr[i]):
			ans = n - 1
			break
		elif i > 0 and i < n - 1 and (arr[i] == a) and (arr[i - 1] != arr[i] or arr[i + 1] != arr[i]):
			ans = i
			break
	print(ans + 1)


import os
import sys
from io import BytesIO, IOBase
import math
from itertools import permutations
from decimal import *
getcontext().prec = 25
MOD = pow(10, 9) + 7
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split(' ')))
	m = 0
	mi = -1
	for i in range(1, n - 1):
		if l[i] > l[i - 1] or l[i] > l[i + 1]:
			if l[i] > m:
				m = l[i]
				mi = i + 1
	if l[0] > l[1]:
		if l[0] > m:
			m = l[0]
			mi = 1
	if l[-1] > l[-2]:
		if l[-1] > m:
			m = l[-1]
			mi = n
	print(mi)


def solve():
	n = int(input())
	l = list(map(int, input().split()))
	al = []
	m = -99999999
	b = False
	for i in range(n):
		if m < l[i]:
			m = l[i]
	for i in range(n):
		if l[i] == m:
			al.append(i)
	for i in al:
		if i == 0 and l[i + 1] < m or (i == n - 1 and l[i - 1] < m):
			print(i + 1)
			return
		if i > 0 and i < n - 1 and (l[i + 1] < m or l[i - 1] < m):
			print(i + 1)
			return
	print(-1)
for t in range(int(input())):
	solve()


def get_dom(a, n):
	mx = max(a)
	for i in range(n):
		if a[i] != mx:
			for j in range(i, -1, -1):
				if a[j] == mx:
					return j + 1
			for j in range(i, n):
				if a[j] == mx:
					return j + 1
	return -1
for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print(get_dom(a, n))


for T in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	high = max(a)
	flag = True
	for i in range(n):
		if i != n - 1 and (a[i] == high and a[i + 1] != high) or (i != 0 and (a[i] == high and a[i - 1] != high)):
			flag = False
			print(i + 1)
			break
	if flag:
		print(-1)


t = int(input())
import array as arr
ans = arr.array('i', [0] * t)
for i in range(t):
	n = int(input())
	x = arr.array('i', list(map(int, input().split())))
	xm = max(x)
	xmin = min(x)
	im = x.index(xm)
	if xmin == xm:
		ans[i] = -1
	elif im != 0:
		ans[i] = im + 1
	else:
		while x[im + 1] == xm:
			im += 1
		ans[i] = im + 1
for i in ans:
	print(i)


import sys
import math as m

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def lts(l):
	s = ''.join(map(str, l))
	return s

def stl(s):
	l = list(s)
	return l

def sq(a, target, arr=[]):
	s = sum(arr)
	if s == target:
		return arr
	if s >= target:
		return
	for i in range(len(a)):
		n = a[i]
		remaining = a[i + 1:]
		ans = sq(remaining, target, arr + [n])
		if ans:
			return ans
mod = int(1000000000.0) + 7

def sinp():
	return sys.stdin.readline().strip()

def iinp():
	return int(input())

def ninp():
	return map(int, sys.stdin.readline().strip().split())

def llinp():
	return list(map(int, sys.stdin.readline().strip().split()))

def p(xyz):
	print(xyz)

def p2(a, b):
	print(a, b)
for _ in range(iinp()):
	n = iinp()
	a = llinp()
	m = max(a)
	f = 0
	for i in range(len(a)):
		if a[i] == m:
			if i == 0:
				if a[i + 1] < a[i]:
					if f == 0:
						print(i + 1)
						f = 1
						break
			elif i == len(a) - 1:
				if a[i - 1] < a[i]:
					if f == 0:
						print(i + 1)
						f = 1
						break
			elif a[i - 1] < a[i] or a[i + 1] < a[i]:
				if f == 0:
					print(i + 1)
					f = 1
					break
	if f == 0:
		print(-1)


import os, sys
from io import IOBase, BytesIO
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def get_input(a=str):
	return a(input())

def get_int_input():
	return get_input(int)

def get_input_arr(a):
	return list(map(a, input().split()))

def get_int_input_arr():
	return get_input_arr(int)

def solve():
	t = get_int_input()
	for _ in range(t):
		n = get_int_input()
		arr = get_int_input_arr()
		mx_val = max(arr)
		res = False
		for i in range(n):
			left_found = False
			right_found = False
			if arr[i] == mx_val:
				if i > 0:
					left_found = arr[i - 1] < arr[i]
				if i < n - 1:
					right_found = arr[i + 1] < arr[i]
			if (left_found or right_found) and arr[i] == mx_val:
				res = True
				cout << i + 1 << endl
				break
		if res:
			continue
		cout << -1 << endl

def main():
	solve()
main()


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ans = 0
	dom = max(a)
	ind = []
	for i in range(n):
		if a[i] == dom:
			ind.append(i)
	loc = -1
	for x in ind:
		if x == 0:
			if a[1] < a[x]:
				loc = x + 1
				break
		elif x == n - 1:
			if a[n - 2] < a[x]:
				loc = x + 1
				break
		elif a[x - 1] < a[x] or a[x + 1] < a[x]:
			loc = x + 1
	print(loc)


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	cnt = 0
	l1 = sorted(l)
	a = l1[-1]
	for i in range(len(l) - 1):
		if l[i] > l[i + 1] and l[i] == a:
			cnt += i + 1
			break
	if cnt == 0:
		for i in range(len(l) - 1, 0, -1):
			if l[i] > l[i - 1] and l[i] == a:
				cnt += i + 1
				break
	if cnt == 0:
		print(-1)
	else:
		print(cnt)


for _ in range(int(input())):
	n = int(input())
	data = [int(x) for x in input().split()]
	if len(set(data)) == 1:
		print(-1)
	else:
		temp = max(data)
		ans = 0
		for q in range(n):
			if data[q] == temp:
				if q == 0:
					if data[1] < temp:
						pos = 1
						break
				elif q == n - 1:
					if data[-2] < temp:
						pos = n
						break
				elif data[q - 1] < temp or data[q + 1] < temp:
					pos = q + 1
					break
		print(pos)


import sys
LI = lambda : list(map(int, sys.stdin.readline().strip('\n').split()))
MI = lambda : map(int, sys.stdin.readline().strip('\n').split())
SI = lambda : sys.stdin.readline().strip('\n')
II = lambda : int(sys.stdin.readline().strip('\n'))
for _ in range(II()):
	n = II()
	a = LI()
	tmp = set(a)
	ans = -1
	if len(tmp) > 1:
		m = -1
		for (i, v) in enumerate(a):
			if v > m and (i and v > a[i - 1] or (i < n - 1 and v > a[i + 1])):
				m = v
				ans = i + 1
	print(ans)


import sys

def solve():
	n = int(input())
	li = [int(i) for i in input().split()]
	same = True
	a = int(0)
	j = int(-1)
	for i in li:
		if i > a:
			a = i
	for i in range(len(li)):
		if li[i] == a:
			if i > 0:
				if li[i] > li[i - 1]:
					same = False
					print(i + 1)
					break
			if i < n - 1:
				if li[i] > li[i + 1]:
					same = False
					print(i + 1)
					break
	if same:
		print(-1)
while True:
	line = sys.stdin.readline()
	if not line:
		break
	for cas in range(int(line)):
		solve()


import sys
import math
from collections import defaultdict, deque
input = sys.stdin.readline

def inar():
	return [int(el) for el in input().split()]

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		arr = inar()
		take = max(arr)
		ans = -1
		for i in range(n):
			lol = 0
			if arr[i] == take:
				if i - 1 >= 0 and arr[i - 1] < arr[i]:
					lol = 1
				if i + 1 < n and arr[i + 1] < arr[i]:
					lol = 1
			if lol:
				ans = i + 1
				break
		print(ans)
main()


def dom(l, n):
	p = max(l)
	if len(set(l)) == 1:
		return -1
	if l[0] == p and l[1] < l[0]:
		return 1
	if l[n - 1] == p and l[n - 2] < l[n - 1]:
		return n
	i = 1
	while i < n - 1:
		if l[i] == p and (l[i - 1] < l[i] or l[i + 1] < l[i]):
			return i + 1
		i += 1
t = int(input())
for g in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	print(dom(l, n))


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print(-1)
	else:
		z = max(arr)
		if arr[0] == z and arr[1] != z:
			print(1)
		elif arr[-1] == z and arr[-2] != z:
			print(n)
		else:
			for kk in range(1, n - 1):
				if arr[kk] == z and (arr[kk + 1] != z or arr[kk - 1] != z):
					print(kk + 1)
					break


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if a.count(a[0]) == n:
		print(-1)
	else:
		x = max(a)
		if a.count(x) == 1:
			print(a.index(x) + 1)
		elif a.index(x) != 0 and a.index(x) != n - 1:
			print(a.index(x) + 1)
		else:
			for i in range(0, n - 1):
				if a[i] == x:
					if a[i + 1] != x:
						print(i + 1)
						break
				elif a[i] != x and a[i + 1] == x:
					print(i + 2)
					break


def hi(a):
	m = max(a)
	for j in range(len(a)):
		if a[j] == m:
			if j - 1 >= 0:
				if a[j - 1] < a[j]:
					return j + 1
			if j + 1 < len(a):
				if a[j + 1] < a[j]:
					return j + 1
	return -1
t = int(input())
b = []
for i in range(t):
	p = int(input())
	a = list(map(int, input().split(' ')))
	b.append(hi(a))
for i in range(len(b)):
	print(b[i])


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(j) for j in input().split()]
	if arr.count(arr[0]) == len(arr):
		print(-1)
		continue
	ma = max(arr)
	for i in range(1, n):
		if arr[i] == ma and arr[i - 1] != ma:
			ans = i
			break
	for i in range(n - 1):
		if arr[i] == ma and arr[i + 1] != ma:
			ans = i
			break
	print(ans + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(a) == 1:
		print(1)
	elif len(a) == 2:
		if a[0] == a[1]:
			print(-1)
		elif a[0] > a[1]:
			print(1)
		else:
			print(2)
	else:
		b = sorted(a)[:]
		if b[-1] == b[0]:
			print(-1)
		elif a.count(b[-1]) == 1:
			print(a.index(b[-1]) + 1)
		elif a[0] == b[-1] and a[1] < a[0]:
			print(1)
		elif a[-1] == b[-1] and a[-2] < a[-1]:
			print(n)
		else:
			for i in range(1, n - 1):
				if a[i] == b[-1] and (a[i] > a[i - 1] or a[i] > a[i + 1]):
					print(i + 1)
					break


for i in range(int(input())):
	l = int(input())
	p = list(map(int, input().split()))
	a = max(p)
	ans = True
	for j in range(len(p) - 1):
		if p[j] == a:
			if p[j + 1] < a:
				print(j + 1)
				ans = False
				break
			elif j > 0 and p[j - 1] < a:
				print(j + 1)
				ans = False
				break
	if p[-1] == a and ans and (p[-2] < a):
		print(l)
		ans = False
	if ans or len(set(p)) == 1:
		print(-1)


test_cases = int(input())
for test_case in range(test_cases):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	ans = -1
	for i in range(n):
		if i != 0 and i != n - 1:
			if a[i] == mx:
				if a[i - 1] < a[i] or a[i + 1] < a[i]:
					ans = i + 1
					break
		elif i == 0:
			if a[0] == mx:
				if a[1] < a[0]:
					ans = 1
					break
		elif i == n - 1:
			if a[-1] == mx:
				if a[-1] > a[-2]:
					ans = n
					break
	print(ans)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	A = list(map(int, input().split(' ')))
	large = []
	m = max(A)
	for i in range(n):
		if A[i] == m:
			large.append(i + 1)
	if len(large) == 1:
		print(large[0])
	elif len(large) == n:
		print(-1)
	else:
		for i in range(len(large)):
			if large[i] == 1:
				if 2 not in large:
					print(1)
					break
			elif large[i] == n:
				if n - 1 not in large:
					print(n)
					break
			else:
				index = large[i] - 1
				if index > 0:
					if A[index - 1] != A[index]:
						print(large[i])
						break
				if index < n - 1:
					if A[index + 1] != A[index]:
						print(large[i])
						break


for __ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ma = max(a)
	answer = -1
	for i in range(n):
		if a[i] == ma:
			if i - 1 >= 0 and a[i - 1] < ma:
				answer = i + 1
				break
			if i + 1 < n and a[i + 1] < ma:
				answer = i + 1
				break
	print(answer)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	M = max(a)
	ans = -1
	for i in range(n):
		if a[i] == M:
			flag = False
			if i - 1 >= 0 and a[i] > a[i - 1]:
				flag = True
			if i + 1 < n and a[i] > a[i + 1]:
				flag = True
			if flag:
				ans = i + 1
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = input().split()
	for x in range(n):
		a[x] = int(a[x])
	asorted = sorted(a)
	if len(a) == 1:
		print(1)
	elif asorted[0] == asorted[n - 1]:
		print(-1)
	else:
		for x in range(0, n):
			if x == 0:
				if a[x] == asorted[n - 1] and a[x + 1] != asorted[n - 1]:
					c = x
					break
			elif x == n - 1:
				if a[x] == asorted[n - 1] and a[x - 1] != asorted[n - 1]:
					c = x
					break
			elif a[x] == asorted[n - 1] and a[x + 1] != asorted[n - 1] or (a[x] == asorted[n - 1] and a[x - 1] != asorted[n - 1]):
				c = x
				break
		print(c + 1)


t = int(input(''))
for _ in range(t):
	n = int(input(''))
	arr = list(map(int, input().split()))
	find = 0
	mx = max(arr)
	if arr.count(mx) == n:
		print(-1)
		continue
	if arr.count(mx) == 1:
		print(arr.index(mx) + 1)
		continue
	ans = -1
	for i in range(n):
		if arr[i] == mx:
			if i == 0:
				if arr[i + 1] != mx:
					ans = i
					break
			elif i == n - 1:
				if arr[i - 1] != mx:
					ans = i
					break
			elif arr[i - 1] != mx or arr[i + 1] != mx:
				ans = i
				break
	if ans == -1:
		print(ans)
	else:
		print(ans + 1)


test_case = int(input())
for _ in range(test_case):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
	else:
		max_number = max(a)
		max_number_idxs = []
		for i in range(n):
			if a[i] == max_number:
				max_number_idxs.append(i)
		ok = []
		if len(max_number_idxs) == 1:
			print(max_number_idxs[0] + 1)
		else:
			for i in range(len(max_number_idxs)):
				if max_number_idxs[i] - 1 >= 0:
					if a[max_number_idxs[i] - 1] < max_number:
						ok.append(max_number_idxs[i])
				if max_number_idxs[i] + 1 <= n - 1:
					if a[max_number_idxs[i] + 1] < max_number:
						ok.append(max_number_idxs[i])
			print(ok[0] + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = a[::-1]
	amaxx = max(a)
	aminn = min(a)
	if aminn == amaxx:
		print(-1)
		continue
	am = a.index(amaxx)
	bm = b.index(amaxx)
	if a[0] == amaxx:
		ind = 1
		while True:
			if a[ind] < amaxx:
				print(ind)
				break
			ind += 1
		continue
	else:
		print(am + 1)


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	ans = -1
	m = max(lst)
	for i in range(n):
		if lst[i] == m:
			if i != 0 and lst[i - 1] < lst[i]:
				ans = i + 1
				break
			if i != n - 1 and lst[i + 1] < lst[i]:
				ans = i + 1
				break
	print(ans)


import sys
read = sys.stdin.read

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = tuple(map(int, input().split()))
		if max(a) == min(a):
			print(-1)
		else:
			ma = max(a)
			mai = [i for (i, v) in enumerate(a) if v == ma]
			for maie in mai:
				if maie == 0:
					if a[1] != ma:
						print(1)
						break
				elif maie == n - 1:
					if a[-2] != ma:
						print(n)
						break
				elif a[maie - 1] != ma or a[maie + 1] != ma:
					print(maie + 1)
					break
main()


caseNum = int(input())
for i in range(caseNum):
	piranhaNum = int(input())
	piranhaSize = list(map(int, input().split(' ')))
	largestPira = max(piranhaSize)
	find = False
	for j in range(piranhaNum):
		if j == 0:
			if piranhaSize[j] == largestPira and piranhaSize[j] > piranhaSize[j + 1]:
				find = True
				print(j + 1)
				break
		elif j == piranhaNum - 1:
			if piranhaSize[j] == largestPira and piranhaSize[j] > piranhaSize[j - 1]:
				find = True
				print(j + 1)
				break
		elif piranhaSize[j] == largestPira and piranhaSize[j] > min(piranhaSize[j - 1], piranhaSize[j + 1]):
			find = True
			print(j + 1)
			break
	if not find:
		print(-1)


cases = int(input())
for _ in range(cases):
	n = int(input())
	ds = list(map(int, input().split()))
	mv = max(ds)
	found = False
	for (i, v) in enumerate(ds):
		if v == mv:
			if i > 0 and ds[i - 1] < mv:
				print(i + 1)
				found = True
				break
			elif i + 1 < n and ds[i + 1] < mv:
				print(i + 1)
				found = True
				break
	if not found:
		print(-1)


for x in range(int(input())):
	n = int(input())
	l = [int(i) for i in input().split()]
	m = max(l)
	a = l
	if len(list(set(a))) == 1:
		print(-1)
	else:
		for i in range(n):
			if l[i] == m:
				if i < n - 1 and i != 0:
					if l[i + 1] != m or l[i - 1] != m:
						print(i + 1)
						break
				elif i == 0:
					if l[i + 1] != m:
						print(i + 1)
						break
				elif i == n - 1:
					if l[i - 1] != m:
						print(i + 1)


resultados = list()
cases = int(input())
for _ in range(cases):
	mayor = pirana = 0
	size = int(input())
	peces = input()
	peces = peces.split(' ')
	peces = list(map(int, peces))
	peces_mayor = sorted(peces, reverse=True)
	mayor = peces_mayor[0]
	for n in range(len(peces)):
		if peces[n] == mayor:
			if n == 0:
				if peces[n + 1] < mayor:
					pirana = n + 1
					break
					break
			elif n + 1 < len(peces):
				if peces[n - 1] < mayor or peces[n + 1] < mayor:
					pirana = n + 1
					break
					break
				else:
					pass
			elif peces[n - 1] < mayor:
				pirana = n + 1
				break
	if pirana == 0:
		pirana = -1
	resultados.append(pirana)
for n in range(len(resultados)):
	print(resultados[n])


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	num = a.count(m)
	if num == n:
		print(-1)
	else:
		ind = 0
		for i in range(n):
			if a[i] == m:
				if i == 0:
					if a[i] > a[i + 1]:
						ind = 1
				elif i == n - 1:
					if a[i] > a[i - 1]:
						ind = n
				elif a[i] > a[i + 1] or a[i] > a[i - 1]:
					ind = i + 1
		if ind == 0:
			print(-1)
		else:
			print(ind)


from os import path
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input().rstrip()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')
file = 1

def solve():
	for _ in range(ii()):
		n = ii()
		a = li()
		if len(set(a)) == 1:
			print('-1')
			continue
		x = max(a)
		p = []
		for i in range(n):
			if a[i] == x:
				p.append(i)
		ans = -2
		for i in p:
			if i > 0 and i < n - 1:
				if a[i - 1] != x or a[i + 1] != x:
					ans = i
					break
			if i == 0:
				if a[i + 1] != x:
					ans = i
					break
			if i == n - 1:
				if a[i - 1] != x:
					ans = i
					break
		print(ans + 1)
if file:
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	else:
		input = sys.stdin.readline
solve()


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	n = int(input())
	A = list(map(int, input().split()))
	v = max(A)
	flag = 0
	for i in range(n):
		if A[i] != v:
			flag = 1
			break
	if flag == 1:
		ans = n
		for i in range(n - 1):
			if A[i] == v and A[i + 1] != v:
				ans = i + 1
				break
		for i in range(n - 1, 0, -1):
			if A[i] == v and A[i - 1] != v:
				ans = i + 1
				break
		print(ans)
	else:
		print(-1)


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import random
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		n = I()
		l = list(In())
		ans = -1
		temp = l[0]
		size = 1
		for x in range(1, n):
			if l[x] < temp:
				size += 1
				temp += 1
			else:
				break
		if size == n:
			print(1)
			return
		temp = l[-1]
		size = 1
		for x in range(n - 2, -1, -1):
			if l[x] < temp:
				temp += 1
				size += 1
		if size == n:
			print(n)
			return
		for i in range(1, n - 1):
			(x, y) = (i - 1, i + 1)
			temp = l[i]
			size = 1
			while size < n:
				if l[x] < temp and x >= 0:
					x -= 1
					temp += 1
					size += 1
				elif l[y] < temp and y < n:
					y += 1
					temp += 1
					size += 1
				else:
					break
			if size == n:
				ans = i
				break
		if ans != -1:
			print(ans + 1)
		else:
			print(-1)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


for t in range(int(input())):
	n = int(input())
	entry = input().split(' ')
	for i in range(n):
		entry[i] = int(entry[i])
	m = max(entry)
	indx = -2
	for i in range(n):
		if entry[i] == m:
			if i > 0:
				if entry[i - 1] < m:
					indx = i
					break
			if i + 1 < n:
				if entry[i + 1] < m:
					indx = i
					break
	print(indx + 1)


try:
	for _ in range(int(input())):
		n = int(input())
		arr = [int(x) + (n - 1) for x in input().split()]
		if len(set(arr)) == 1:
			print('-1')
		else:
			a = max(arr)
			ans = arr.index(a)
			for i in range(ans, n - 1):
				if arr[i] > arr[i + 1]:
					ans = i
					break
			print(ans + 1)
except:
	pass


for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print(-1)
	else:
		mx = max(arr)
		if arr[0] == mx and arr[0] > arr[1]:
			idx = 1
		if arr[n - 1] == mx and arr[n - 1] > arr[n - 2]:
			idx = n
		for i in range(1, n - 1):
			if arr[i] == mx and (arr[i] > arr[i - 1] or arr[i] > arr[i + 1]):
				idx = i + 1
		print(idx)


t = int(input())
while t:
	t -= 1
	n = int(input())
	g = []
	idx = 0
	l = list(map(int, input().split()))
	if l.count(l[0]) == n:
		print(-1)
	elif l.count(max(l)) == 1:
		print(l.index(max(l)) + 1)
	else:
		k = max(l)
		if l[0] == k and l[0] > l[1]:
			print(1)
		else:
			for i in range(1, n):
				if l[i] == k and (l[i] > l[i + 1] or l[i] > l[i - 1]):
					print(i + 1)
					break


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	val = []
	for i in range(n):
		if i == 0:
			if a[i] > a[i + 1]:
				val.append(i)
		elif i == n - 1:
			if a[i] > a[i - 1]:
				val.append(i)
		elif a[i] > a[i + 1] or a[i] > a[i - 1]:
			val.append(i)
	if val == []:
		print(-1)
		continue
	ind = 0
	for i in range(len(val)):
		if a[val[i]] > a[val[ind]]:
			ind = i
	print(val[ind] + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	m = 0
	ind = 0
	win = False
	for i in range(n):
		if a[i] > m:
			m = a[i]
			ind = i
		if a[i] != a[0]:
			win = True
	if not win:
		print(-1)
		continue
	if ind == 0 and a[1] == m:
		for i in range(n - 1):
			if a[i + 1] < m:
				ind = i
				break
	print(ind + 1)


t = int(input())
for i in range(t):
	n = int(input())
	fish = list(map(int, input().split()))
	mx = max(fish)
	last_m = -1
	psbl = False
	for i in range(n):
		if fish[i] == mx:
			last_m = i
			if psbl:
				break
		else:
			psbl = True
			if last_m > -1:
				break
	if psbl:
		print(last_m + 1)
	else:
		print(-1)


def pyranha(n, a):
	counter = 0
	for i in range(n - 1):
		if a[i] == a[i + 1]:
			counter += 1
			if counter == n - 1:
				return -1
	else:
		maximus = max(a)
		for i in range(len(a)):
			if a[i] == maximus and i != 0:
				return i + 1
			elif a[i] == maximus and i == 0:
				for j in range(len(a)):
					if a[j] != a[j + 1]:
						return j + 1
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	print(pyranha(n, a))


def main():
	n = int(input())
	arr = list(map(int, input().split()))
	Max = max(arr)
	if n == 1:
		print(1)
	elif len(set(arr)) == 1:
		print(-1)
	else:
		idx = -1
		for i in range(n):
			if arr[i] == Max:
				if i + 1 < n and arr[i] != arr[i + 1]:
					idx = i + 1
				if i - 1 >= 0 and arr[i] != arr[i - 1]:
					idx = i + 1
		if idx == -1:
			print(-1)
		else:
			print(idx)
x = int(input())
while x > 0:
	main()
	x -= 1


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if max(a) == min(a):
		print(-1)
	else:
		ind = 0
		maxel = max(a)
		if a[n - 1] == maxel and a[n - 2] != maxel:
			print(n)
		elif a[0] == maxel and a[1] != maxel:
			print(1)
		else:
			for j in range(1, n - 1):
				if a[j] == maxel:
					if a[j] > a[j - 1] or a[j] > a[j + 1]:
						ind = j + 1
						print(ind)
						break


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print(-1)
	else:
		maxi = max(arr)
		ind = []
		for i in range(n):
			if arr[i] == maxi:
				ind.append(i + 1)
		ans = ind[0]
		for i in range(1, len(ind)):
			if ind[i] - ind[i - 1] != 1:
				ans = ind[i]
				break
		else:
			if ind[-1] != n:
				ans = ind[-1]
		print(ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
	else:
		m = max(a)
		for i in range(n):
			if a[i] == m:
				flag1 = 1
				flag2 = 1
				if i == 0 or a[i - 1] == m:
					flag1 = 0
				if i == n - 1 or a[i + 1] == m:
					flag2 = 0
				if flag1 | flag2 == 1:
					print(i + 1)
					break


T = int(input())
for _ in range(T):
	n = int(input())
	p = list(map(int, input().split()))
	l = [p[0]] * n
	if p == l:
		print(-1)
	else:
		m = max(p)
		if p[0] == m and p[0] > p[1]:
			print(1)
		elif p[n - 1] == m and p[n - 1] > p[n - 2]:
			print(n)
		else:
			for j in range(1, n - 1):
				if p[j] == m and p[j] > p[j - 1]:
					print(j + 1)
					break
				elif p[j] == m and p[j] > p[j + 1]:
					print(j + 1)
					break


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	maxl = max(l)
	index = -1
	for i in range(n):
		if l[i] == maxl and (i > 0 and l[i - 1] < l[i] or (i < n - 1 and l[i + 1] < l[i])):
			index = i + 1
	print(index)


for i in range(int(input())):
	n = int(input())
	l = [int(x) for x in input().split()]
	if len(l) == l.count(l[0]):
		print(-1)
	else:
		maxv = max(l)
		for i in range(n):
			if l[i] == maxv:
				if i - 1 >= 0:
					if l[i] > l[i - 1]:
						index = i
				if i + 1 < n:
					if l[i] > l[i + 1]:
						index = i
		print(index + 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)


for tt in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	found = 0
	for i in range(n):
		if a[i] == mx:
			cur = mx
			(l, r) = (i - 1, i + 1)
			while 0 <= l and a[l] < cur or (r < n and cur > a[r]):
				if 0 <= l and a[l] < cur:
					l -= 1
					cur += 1
				if r < n and a[r] < cur:
					r += 1
					cur += 1
			if l == -1 and r == n:
				found = 1
				print(i + 1)
				break
	if not found:
		print(-1)


for __ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	(temp, status) = (0, 0)
	for i in a:
		if i == mx:
			if temp == 0:
				if a[temp + 1] < mx:
					temp = 1
					status = 1
					break
			elif temp < n - 1:
				if a[temp - 1] < mx or a[temp + 1] < mx:
					temp += 1
					status = 1
					break
			elif a[temp - 1] < mx:
				temp = n
				status = 1
				break
		temp += 1
	if status:
		print(temp)
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	pirahnas = list(map(int, input().split()))
	lst = sorted(pirahnas)
	small = lst[0]
	if lst[0] == lst[n - 1]:
		print(-1)
		continue
	big = lst[n - 1]
	for i in range(n - 1):
		if pirahnas[i] > pirahnas[i + 1]:
			if pirahnas[i] == big:
				index = i
				break
		if pirahnas[i] < pirahnas[i + 1]:
			if pirahnas[i + 1] == big:
				index = i + 1
				break
	print(index + 1)


def safe_pos(i, size):
	if i == 0:
		return [i + 1, i + 1]
	elif i == size - 1:
		return [i - 1, i - 1]
	else:
		return [i - 1, i + 1]

def solve():
	n = int(input())
	array = list(map(int, input().split()))
	maxElem = max(*array)
	for i in range(len(array)):
		if array[i] == maxElem:
			(l, r) = safe_pos(i, len(array))
			if array[i] > array[l] or array[i] > array[r]:
				print(i + 1)
				return
	print(-1)
tests = int(input())
while tests > 0:
	solve()
	tests -= 1


from sys import stdin
nii = lambda : map(int, stdin.readline().split())
lnii = lambda : list(map(int, stdin.readline().split()))
from heapq import *
t = int(input())
for i in range(t):
	n = int(input())
	a = [-int(i) for i in stdin.readline().split()]
	b = a[:]
	heapify(a)
	if len(set(a)) == 1:
		print(-1)
		continue
	mv = a[0]
	for i in range(n):
		if b[i] == mv:
			if i - 1 >= 0 and b[i - 1] != mv:
				print(i + 1)
				break
			if i + 1 < n and b[i + 1] != mv:
				print(i + 1)
				break


for a0 in range(int(input())):
	n = int(input())
	l = [int(x) for x in input().split()]
	m = max(l)
	for i in range(n):
		if i > 0:
			if l[i] == m and l[i - 1] < l[i]:
				print(i + 1)
				break
		if i < n - 1:
			if l[i] == m and l[i + 1] < l[i]:
				print(i + 1)
				break
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	i = l.index(m)
	if i == 0:
		while i < n - 1 and l[i] == l[i + 1] and (l[i] == m):
			i += 1
		temp = set(l)
		if len(temp) == 1:
			print(-1)
		else:
			print(i + 1)
	else:
		temp = set(l)
		if len(temp) == 1:
			print(-1)
		else:
			print(i + 1)


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	f = -2
	for i in range(len(a)):
		if a[i] == m:
			if i == 0:
				if a[i + 1] < a[i]:
					f = i
					break
			elif i == n - 1:
				if a[i - 1] < a[i]:
					f = i
					break
			elif a[i - 1] < a[i] or a[i + 1] < a[i]:
				f = i
				break
	print(f + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	x = max(arr)
	q = list(set(arr))
	if len(q) == 1:
		print(-1)
	elif arr[0] == x and arr[1] != x:
		print(1)
	else:
		for i in range(1, n):
			if arr[i] == x and (arr[i - 1] != x or arr[i + 1] != x):
				break
		print(i + 1)


from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(*l)
	f = False
	j = 0
	for i in range(0, n):
		if i != 0 and i != n - 1:
			if l[i] == m and (l[i - 1] < l[i] or l[i + 1] < l[i]):
				j = i
				f = True
				break
		elif i == 0 and l[i] == m and (l[i + 1] < l[i]):
			j = i
			f = True
			break
		elif i == n - 1 and l[i] == m and (l[i - 1] < l[i]):
			j = i
			f = True
			break
	if not f:
		print(-1)
	else:
		print(j + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	parahnas = list(map(int, input().split()))
	indexes = []
	maxi = max(parahnas)
	for i in range(len(parahnas)):
		if parahnas[i] == maxi:
			indexes.append(i)
	flag = False
	for ind in indexes:
		if ind + 1 <= n - 1 and ind - 1 >= 0:
			if parahnas[ind + 1] < parahnas[ind] or parahnas[ind - 1] < parahnas[ind]:
				print(ind + 1)
				flag = True
				break
		elif ind == 0:
			if parahnas[ind + 1] < parahnas[ind]:
				print(ind + 1)
				flag = True
				break
		elif ind + 1 > n - 1:
			if parahnas[ind - 1] < parahnas[ind]:
				print(ind + 1)
				flag = True
				break
		elif ind - 1 < -1:
			if parahnas[ind + 1] <= parahnas[ind]:
				flag = True
				print(ind + 1)
				break
	if not flag:
		print(-1)


n = int(input())
for i in range(n):
	t = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	if l.count(m) == t:
		print(-1)
		continue
	for i in range(len(l)):
		if l[i] == m:
			if i == 0 and l[i] > l[i + 1]:
				print(i + 1)
				break
			elif i == t - 1 and l[i] > l[i - 1]:
				print(i + 1)
				break
			elif (i != 0 and i != t - 1) and (l[i] > l[i + 1] or l[i] > l[i - 1]):
				print(i + 1)
				break


from sys import stdin, gettrace
if gettrace():
	inputi = input
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()

def solve():
	n = int(inputi())
	aa = [int(a) for a in inputi().split()]
	if all((a == aa[0] for a in aa)):
		print(-1)
		return
	ma = max(aa)
	f = aa.index(ma)
	if f > 0:
		print(f + 1)
		return
	for (i, a) in enumerate(aa):
		if a != ma:
			print(i)
			return

def main():
	t = int(inputi())
	for _ in range(t):
		solve()
main()


def proC(arr):
	k = max(arr)
	for i in range(len(arr)):
		if arr[i] == k:
			if 0 <= i - 1 and arr[i] > arr[i - 1]:
				return i + 1
			if i + 1 <= len(arr) - 1 and arr[i] > arr[i + 1]:
				return i + 1
	return -1
t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(proC(arr))


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
import threading
import sys
import time

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))

def solve():
	n = get_int()
	ls = get_list()
	mi = max(ls)
	ans = -1
	for (i, v) in enumerate(ls):
		if v == mi:
			if i > 0 and ls[i - 1] < mi:
				ans = i + 1
				break
			elif i < n - 1 and ls[i + 1] < mi:
				ans = i + 1
				break
	print(ans)

def main():
	solve()
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


n = int(input())
a = []
for i in range(n):
	x = int(input())
	b = list(map(int, input().split()))
	c = sorted(b)
	max_b = c[-1]
	m = len(b)
	for i in range(m):
		if i == 0:
			if b[0] == max_b and b[1] < b[0]:
				a.append(1)
				break
		elif i == m - 1:
			if b[-1] == max_b and b[-1] > b[-2]:
				a.append(m)
				break
			else:
				a.append(-1)
				break
		elif b[i] == max_b and (b[i + 1] < b[i] or b[i - 1] < b[i]):
			a.append(i + 1)
			break
for i in a:
	print(i)


import sys

def rl():
	return sys.stdin.readline().strip()

def pr(something):
	sys.stdout.write(str(something) + '\n')

def pra(array):
	sys.stdout.write(' '.join([str(x) for x in array]) + '\n')

def solve(array):
	mx = max(array)
	dom_i = -1
	if array[0] == mx and array[1] < mx:
		dom_i = 1
	elif array[-1] == mx and array[-2] < mx:
		dom_i = len(array)
	else:
		for i in range(1, len(array) - 1):
			if array[i] == mx and (array[i - 1] < mx or array[i + 1] < mx):
				dom_i = i + 1
				break
	return dom_i
NT = int(rl())
for ti in range(NT):
	_ = rl()
	array = [int(x) for x in rl().split(' ')]
	res = solve(array)
	pr(res)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		ans = -1
	else:
		max_val = max(a)
		for (i, val) in enumerate(a):
			if val == max_val:
				if i == 0:
					if val > a[1]:
						ans = i + 1
						break
				elif i == n - 1:
					if val > a[-2]:
						ans = i + 1
						break
				elif a[i - 1] < val or val > a[i + 1]:
					ans = i + 1
					break
	print(ans)


mod = pow(10, 9) + 7

def sp():
	return map(int, input().split())

def lit():
	return list(sp())

def fun(x):
	return sum((int(i) for i in str(x)))

def find(n):
	if n == 3:
		return 3
	while 1:
		flag = 0
		for i in range(2, int(sqrt(n)) + 1):
			if n % i == 0:
				n += 1
				break
			if i == int(sqrt(n)):
				flag = 1
				break
		if flag:
			break
	return n
t = int(input())
for _ in range(t):
	n = int(input())
	l = lit()
	if min(l) == max(l):
		print('-1')
	else:
		k = max(l)
		f = 0
		for i in range(n - 1):
			if l[i] == k and l[i + 1] < k:
				print(i + 1)
				f = 1
				break
		if f == 0:
			for i in range(1, n):
				if l[i] == k and l[i - 1] < k:
					print(i + 1)
					f = 1
					break


from collections import Counter
import string
import math
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))

def printDivisors(n):
	divisors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				divisors.append(i)
			else:
				divisors.extend((i, n // i))
		i = i + 1
	return divisors

def countTotalBits(num):
	binary = bin(num)[2:]
	return len(binary)

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for _ in range(vary(1)):
	n = vary(1)
	num = array_int()
	if len(set(num)) == 1:
		print(-1)
	else:
		tt = num.index(max(num))
		if tt > 0:
			print(tt + 1)
			continue
		for i in range(n):
			if num[i] != num[tt]:
				print(i)
				break


import sys
import os
from math import sqrt, log, log2, log10, gcd, floor, pow, sin, cos, tan, pi, inf, factorial
from copy import copy, deepcopy
from sys import exit, stdin, stdout
from collections import Counter, defaultdict, deque
from itertools import permutations
import heapq
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = 1000000007
iinp = lambda : int(sys.stdin.readline())
inp = lambda : sys.stdin.readline().strip()
strl = lambda : list(inp().strip().split(' '))
intl = lambda : list(map(int, inp().split(' ')))
mint = lambda : map(int, inp().split())
flol = lambda : list(map(float, inp().split(' ')))
flush = lambda : stdout.flush()

def permute(nums):

	def fun(arr, nums, cur, v):
		if len(cur) == len(nums):
			arr.append(cur.copy())
		i = 0
		while i < len(nums):
			if v[i]:
				i += 1
				continue
			else:
				cur.append(nums[i])
				v[i] = 1
				fun(arr, nums, cur, v)
				cur.pop()
				v[i] = 0
				i += 1
		return arr
	res = []
	nums.sort()
	v = [0] * len(nums)
	return fun(res, nums, [], v)

def subsets(res, index, arr, cur):
	res.append(cur.copy())
	for i in range(index, len(arr)):
		cur.append(arr[i])
		subsets(res, i + 1, arr, cur)
		cur.pop()
	return res

def sieve(N):
	root = int(sqrt(N))
	primes = [1] * (N + 1)
	(primes[0], primes[1]) = (0, 0)
	for i in range(2, root + 1):
		if primes[i]:
			for j in range(i * i, N + 1, i):
				primes[j] = 0
	return primes

def bs(arr, l, r, x):
	if x < arr[0] or x > arr[len(arr) - 1]:
		return -1
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	p = int(sqrt(n))
	for i in range(5, p + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def ups(arr, n):
	ans = 0
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			ans += 1
	return True if ans == 0 else False

def solve():
	n = iinp()
	arr = intl()
	m = max(arr)
	if len(set(arr)) == 1:
		return -1
	j = -1
	for i in range(n - 1):
		if arr[i] == m and arr[i + 1] < m:
			j = i
	k = n
	for i in range(n - 1, 0, -1):
		if arr[i] == m and arr[i] > arr[i - 1]:
			k = i
	if j == -1 and k == n:
		return -1
	elif j != -1:
		return j + 1
	elif k != n:
		return k + 1
for _ in range(iinp()):
	print(solve())


a = int(input())
for i in range(a):
	b = int(input()) - 1
	g = b
	c = list(map(int, input().split()))
	d = 0
	e = 0
	f = 0
	for j in range(b):
		if c[j] > d and (not d):
			d = c[j]
			if c[j] > c[j + 1]:
				f += 1
				e = j + 1
		elif c[j] == d and (not f):
			b -= 1
			if c[j] > c[j + 1]:
				f = 1
				e = j + 1
		elif c[j] > d:
			d = c[j]
			e = j + 1
		elif c[j] == d:
			b -= 1
	if c[g] > d:
		e = g + 1
	elif c[g] == d:
		b -= 1
	if not b:
		print(-1)
	else:
		print(e)


def si():
	return str(input())

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
t = int(input())
for _ in range(t):
	n = ii()
	a = li()
	m = max(a)
	ind = -1
	for i in range(n):
		if a[i] == m:
			if i != 0 and a[i - 1] != m:
				ind = i + 1
				break
			elif i != n - 1 and a[i + 1] != m:
				ind = i + 1
				break
	print(ind)


def ans(fishes):
	if len(set(fishes)) == 1:
		return -1
	target = max(fishes)
	for i in range(len(fishes)):
		if fishes[i] == target and i + 1 < len(fishes) and (fishes[i + 1] < target):
			return 1 + i
		if fishes[i] == target and i - 1 >= 0 and (fishes[i - 1] < target):
			return 1 + i
	return '?'
for _ in range(int(input())):
	input()
	fishes = list(map(int, input().split()))
	print(ans(fishes))


for _ in range(int(input())):
	x = int(input())
	(*li,) = map(int, input().split())
	a = max(li)
	b = li.index(a)
	if li.count(a) == x:
		print(-1)
		continue
	elif li[0] == a and li[1] != a:
		print(1)
		continue
	elif li[-1] == a and li[-2] != a:
		print(x)
		continue
	for i in range(1, x - 1):
		if li[i] == a and (li[i - 1] != a or li[i + 1] != a):
			print(i + 1)
			break


for _ in range(int(input())):
	n = int(input())
	lis = list(map(int, input().strip().split()))
	maxs = max(lis)
	flag = 0
	for x in range(n):
		if lis[x] == maxs:
			if x == 0:
				if lis[x + 1] < maxs:
					flag = 1
					print(x + 1)
					break
			elif 0 < x < n - 1:
				if lis[x - 1] < maxs or lis[x + 1] < maxs:
					flag = 1
					print(x + 1)
					break
			elif x == n - 1:
				if lis[x - 1] < maxs:
					flag = 1
					print(x + 1)
					break
	if flag == 0:
		print('-1')


t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	l = list(map(int, input().split()))
	mx = max(l)
	done = 0
	for i in range(n):
		if l[i] == mx:
			if i - 1 >= 0:
				if l[i - 1] < mx:
					print(i + 1)
					done = 1
					break
			if i + 1 < n:
				if l[i + 1] < mx:
					print(i + 1)
					done = 1
					break
	if done == 0:
		print(-1)


for _ in range(int(input())):
	x = int(input())
	mylist = list(map(int, input().split()))
	amr = dict()
	for i in range(x):
		if i == 0 and mylist[i + 1] < mylist[i]:
			amr[mylist[i]] = i
		elif i == x - 1 and mylist[i - 1] < mylist[i]:
			amr[mylist[i]] = i
		elif i > 0 and i < x - 1:
			if mylist[i - 1] < mylist[i] and mylist[i] >= mylist[i + 1]:
				amr[mylist[i]] = i
			elif mylist[i - 1] <= mylist[i] and mylist[i] > mylist[i + 1]:
				amr[mylist[i]] = i
	mx = -1
	if amr:
		mx = max(amr.items())
		print(mx[1] + 1)
	else:
		print(mx)


def dominantPiranhas(arr):
	t = arr[0]
	i = 1
	while i < len(arr) and arr[i] == t:
		i += 1
	if i == len(arr):
		print(-1)
		return
	m = max(arr)
	for j in range(len(arr)):
		if arr[j] == m:
			if j - 1 >= 0 and arr[j - 1] < arr[j]:
				print(j + 1)
				return
			if j + 1 < len(arr) and arr[j + 1] < arr[j]:
				print(j + 1)
				return
t = int(input())
while t:
	n = int(input())
	arr = [int(x) for x in input().split()]
	dominantPiranhas(arr)
	t -= 1


import sys
input = sys.stdin.readline
from collections import Counter
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(Counter(a).items()) == 1:
		print(-1)
		continue
	nax = max(a)
	ind = []
	for i in range(n):
		if a[i] == nax:
			ind.append(i + 1)
	a.insert(0, a[0])
	a.append(a[n - 1])
	flag = False
	ans = 0
	for i in range(len(ind)):
		if a[ind[i]] == a[ind[i] - 1] and a[ind[i]] == a[ind[i] + 1]:
			pass
		else:
			flag = True
			ans = ind[i]
			break
	print(ans)


a = int(input())
for i in range(a):
	s = int(input())
	z = list(map(int, input().split()))
	if len(z) == z.count(max(z)):
		print(-1)
	else:
		t = max(z)
		flag = 0
		for i in range(len(z)):
			if i > 0 and i < len(z) - 1:
				if (z[i + 1] < t or z[i - 1] < t) and z[i] == t and (flag == 0):
					print(i + 1)
					flag = 1
					break
			else:
				if i == 0 and z[0] == t and (z[1] < t) and (flag == 0):
					print(1)
					flag = 1
					break
				if i == len(z) - 1 and z[-1] == t and (z[-2] < t) and (flag == 0):
					print(len(z))
					flag = 1
					break


for i in range(int(input())):
	a = input()
	b = list(map(int, input().split()))
	m = max(b)
	r = 0
	for i in range(1, len(b) - 1):
		if m == b[i]:
			if b[i - 1] != b[i] or b[i] != b[i + 1]:
				r = 1
				p = i
				break
	if r:
		print(p + 1)
	elif b[0] == m and b[0] != b[1]:
		print(1)
	elif b[len(b) - 1] == m and b[-1] != b[-2]:
		print(len(b))
	else:
		print(-1)


import sys
t = int(input())
for i in range(t):
	n = int(input())
	lst = list(map(int, input().split()))

	def solve_second():
		m = max(lst)
		for i in range(n):
			if lst[i] == m:
				if i - 1 >= 0 and lst[i - 1] < lst[i]:
					print(i + 1)
					return
				if i + 1 < n and lst[i + 1] < lst[i]:
					print(i + 1)
					return

	def solve():
		flag = 1
		for i in range(n):
			if lst[i] != lst[0]:
				flag = 0
				break
		if flag:
			print('-1')
			return
		else:
			solve_second()
	solve()


N = int(input())
for i in range(N):
	n = int(input())
	a = list(map(int, input().split()))
	domIndex = -1
	domMax = 1
	for k in range(n):
		if a[k] > domMax - 1:
			if k != 0 and a[k - 1] < a[k] or (k != n - 1 and a[k + 1] < a[k]):
				domMax = a[k]
				domIndex = k
			elif a[k] > domMax + 1:
				domMax = a[k]
				domIndex = -1
	if domIndex == -1:
		print(domIndex)
	else:
		print(domIndex + 1)


from bisect import *
from collections import *
from math import gcd, ceil, sqrt, floor
from heapq import *
from typing import List
from itertools import *
from operator import add, mul, sub, xor, truediv, floordiv
from functools import *
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

@lru_cache(None)
def fact(x):
	if x < 2:
		return 1
	return fact(x - 1) * x

@lru_cache(None)
def per(i, j):
	return fact(i) // fact(i - j)

@lru_cache(None)
def com(i, j):
	return per(i, j) // fact(j)

def linc(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t > f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rinc(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t < f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def ldec(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t < f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rdec(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t > f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def binfun(x):
	c = 0
	for w in arr:
		c += ceil(w / x)
	return c

def lowbit(n):
	return n & -n

class BIT:

	def __init__(self, arr):
		self.arr = arr
		self.n = len(arr) - 1

	def update(self, x, v):
		while x <= self.n:
			self.arr[x] += v
			x += x & -x

	def query(self, x):
		ans = 0
		while x:
			ans += self.arr[x]
			x &= x - 1
		return ans

class smt:

	def __init__(self, l, r, arr):
		self.l = l
		self.r = r
		self.value = (1 << 31) - 1 if l < r else arr[l]
		mid = (l + r) // 2
		if l < r:
			self.left = smt(l, mid, arr)
			self.right = smt(mid + 1, r, arr)
			self.value &= self.left.value & self.right.value

	def setvalue(self, x, val):
		if self.l == self.r:
			self.value = val
			return
		mid = (self.l + self.r) // 2
		if x <= mid:
			self.left.setvalue(x, val)
		else:
			self.right.setvalue(x, val)
		self.value = self.left.value & self.right.value

	def ask(self, l, r):
		if l <= self.l and r >= self.r:
			return self.value
		val = (1 << 31) - 1
		mid = (self.l + self.r) // 2
		if l <= mid:
			val &= self.left.ask(l, r)
		if r > mid:
			val &= self.right.ask(l, r)
		return val

class UFS:

	def __init__(self, n):
		self.parent = [i for i in range(n)]
		self.ranks = [0] * n

	def find(self, x):
		if x != self.parent[x]:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, u, v):
		(pu, pv) = (self.find(u), self.find(v))
		if pu == pv:
			return False
		if self.ranks[pu] >= self.ranks[pv]:
			self.parent[pv] = pu
			if self.ranks[pv] == self.ranks[pu]:
				self.ranks[pu] += 1
		else:
			self.parent[pu] = pv

def Prime(n):
	c = 0
	prime = []
	flag = [0] * (n + 1)
	for i in range(2, n + 1):
		if not flag[i]:
			prime.append(i)
			c += 1
		for j in range(c):
			if i * prime[j] > n:
				break
			flag[i * prime[j]] = prime[j]
			if i % prime[j] == 0:
				break
	return prime

def dij(s, graph):
	d = {}
	d[s] = 0
	heap = [(0, s)]
	seen = set()
	while heap:
		(dis, u) = heappop(heap)
		if u in seen:
			continue
		for v in graph[u]:
			if v not in d or d[v] > d[u] + graph[u][v]:
				d[v] = d[u] + graph[u][v]
				heappush(heap, (d[v], v))
	return d

def md(a, b, mod):
	return a * pow(b, mod - 2, mod) % mod
t = N()
for i in range(t):
	n = N()
	a = RLL()
	ans = -1
	ma = max(a)
	if all((i == ma for i in a)):
		print(ans)
	else:
		for (i, ch) in enumerate(a):
			if ch == ma:
				if i == 0:
					if ch > a[i + 1]:
						print(i + 1)
						break
				elif ch > a[i - 1] or ch > a[i + 1]:
					print(i + 1)
					break


t = int(input())
for y_qtr in range(t):
	n = int(input())
	s = list(map(int, input().rstrip().split()))
	ans = True
	a = 0
	m = max(s)
	i = s.index(m)
	while ans:
		if i - 1 >= 0 and s[i - 1] < s[i]:
			print(i + 1)
			ans = False
			break
		elif i + 1 < n and s[i + 1] < s[i]:
			print(i + 1)
			ans = False
			break
		else:
			i = i + 1
		if i == n - 1:
			break
	if ans:
		print(-1)


def solve(arr):
	if arr.count(arr[0]) == len(arr):
		print('-1')
	else:
		mx = max(arr)
		for i in range(len(arr)):
			if arr[i] == mx:
				if i != 0 and i != len(arr) - 1:
					if arr[i + 1] < arr[i] or arr[i - 1] < arr[i]:
						print(i + 1)
						break
				elif i == 0:
					if arr[i + 1] < arr[i]:
						print(i + 1)
						break
				elif arr[i - 1] < arr[i]:
					print(i + 1)
					break
i = int(input())
for j in range(i):
	k = int(input())
	m = input().split(' ')
	arr = list(map(int, m))
	solve(arr)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	z = max(a)
	ans = -1
	for i in range(n):
		if a[i] != z:
			continue
		if i - 1 >= 0:
			if a[i - 1] < a[i]:
				ans = i + 1
				break
		if i + 1 < n:
			if a[i + 1] < a[i]:
				ans = i + 1
				break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	if len(set(ar)) == 1:
		print(-1)
	else:
		mx = max(ar)
		ans = 0
		for i in range(n - 1):
			if ar[i] > ar[i + 1] and ar[i] == mx:
				ans = i + 1
			elif ar[i] < ar[i + 1] and ar[i + 1] == mx:
				ans = i + 2
		print(ans)


a = input()
for x in range(int(a)):
	b = input()
	c = input().split(' ')
	d = [int(i) for i in c]
	tag = max(d)
	ans = -1
	for i in range(len(d)):
		if i == 0:
			if d[i] == tag and d[i + 1] < tag:
				ans = i + 1
				break
		elif i == len(d) - 1:
			if d[i] == tag and d[i - 1] < tag:
				ans = i + 1
				break
		elif d[i] == tag and (d[i + 1] < tag or d[i - 1] < tag):
			ans = i + 1
			break
	print(ans)


for _ in range(int(input())):
	input()
	x = list(map(int, input().split()))
	l = max(x)
	ans = -1
	for i in range(len(x)):
		if x[i] == l and (x[max(i - 1, 0)] < x[i] or x[min(i + 1, len(x) - 1)] < x[i]):
			ans = i
	if ans != -1:
		print(ans + 1)
	else:
		print(ans)


import sys
t = int(sys.stdin.readline().strip())
for _ in range(t):
	n = int(sys.stdin.readline().strip())
	piranhas = list(map(int, sys.stdin.readline().strip().split()))
	maxPiranha = max(piranhas)
	ind = -2
	for (i, p) in enumerate(piranhas):
		if p == maxPiranha:
			if i == 0:
				if piranhas[i + 1] < maxPiranha:
					ind = i
					break
			elif i == len(piranhas) - 1:
				if piranhas[i - 1] < maxPiranha:
					ind = i
					break
			elif piranhas[i - 1] < maxPiranha or piranhas[i + 1] < maxPiranha:
				ind = i
				break
	print(ind + 1)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import collections as col

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	A = getInts()
	if len(set(A)) == 1:
		return -1
	m = max(A)
	for j in range(N):
		if A[j] == m and (j > 0 and A[j - 1] < m or (j < N - 1 and A[j + 1] < m)):
			return j + 1
for _ in range(getInt()):
	print(solve())


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	s = list(set(a))
	m = max(a)
	if len(s) == 1:
		print(-1)
	elif a[0] == m and a[1] != m:
		print(1)
	else:
		for ite in range(1, n):
			if a[ite] == m and (a[ite - 1] != m or a[ite + 1] != m):
				break
		print(ite + 1)


def read_generator():
	while True:
		tokens = input().split(' ')
		for t in tokens:
			yield t
reader = read_generator()

def readword():
	return next(reader)

def readint():
	return int(next(reader))

def readfloat():
	return float(next(reader))

def readline():
	return input()

def solve(a):
	m = max(a)
	mc = list(filter(lambda x: x == m, a))
	if len(mc) == len(a):
		return -1
	for i in range(1, len(a)):
		if a[i] != m and a[i - 1] == m:
			return i
	for i in range(len(a) - 1):
		if a[i] != m and a[i + 1] == m:
			return i + 2
tests = readint()
for t in range(tests):
	n = readint()
	a = [readint() for _ in range(n)]
	print(solve(a))


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	t = -1
	m = 0
	for (i, e) in enumerate(a):
		if e > m:
			if i > 0 and a[i - 1] < e:
				t = i + 1
				m = e
			if i < n - 1 and a[i + 1] < e:
				t = i + 1
				m = e
	print(t)


n = int(input())
for _ in range(n):
	n = int(input())
	l = list(map(int, input().split()))
	i = j = l.index(max(l))
	while j < n and l[i] == l[j]:
		j += 1
	print((i or [-2, j - 1][j < n]) + 1)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
from decimal import Decimal
mod = pow(10, 9) + 7

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	n = int(data())
	arr = l()
	if len(set(arr)) == 1:
		out(-1)
		continue
	m = max(arr)
	answer = -1
	for i in range(n):
		if arr[i] == m:
			if i + 1 < n and arr[i + 1] != m:
				answer = i + 1
				break
			if i - 1 >= 0 and arr[i - 1] != m:
				answer = i + 1
				break
	out(answer)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	maxp = l[0]
	minp = l[0]
	minpi = 0
	maxpi = 0
	for i in range(1, n):
		if l[i] >= maxp and (l[i - 1] < l[i] or (i != n - 1 and l[i + 1] < l[i])):
			maxpi = i
			maxp = l[i]
		if l[i] < minp:
			minpi = i
			minp = l[i]
	if maxp == minp:
		print(-1)
	else:
		print(maxpi + 1)


t = int(input())

def argmax(A):
	max = -1
	res = -1
	for (i, a) in enumerate(A):
		if a > max:
			max = a
			res = i + 1
	if res == 1:
		for i in range(1, len(A)):
			res = i
			if A[i] != A[i - 1]:
				break
	return res
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	if len(set(A)) == 1:
		print(-1)
	else:
		print(argmax(A))


def f(arr):
	max_a = max(arr)
	for i in range(len(arr)):
		if arr[i] != max_a:
			continue
		if i == 0 and max_a != arr[i + 1]:
			return i + 1
		elif i == len(arr) - 1 and max_a != arr[i - 1]:
			return i + 1
		elif i != 0 and i != len(arr) - 1 and (max_a != arr[i + 1] or max_a != arr[i - 1]):
			return i + 1
	return -1
for _ in range(int(input())):
	int(input())
	print(f(list(map(int, input().split()))))


T = int(input())
while T > 0:
	n = int(input())
	arr = list(map(int, input().split()))
	temp = arr.copy()
	temp.sort()
	if temp[0] == temp[n - 1]:
		print(-1)
	else:
		res = -1
		target = temp[n - 1]
		for i in range(n):
			if arr[i] == target:
				if i > 0 and arr[i - 1] < target or (i + 1 < n and arr[i + 1] < target):
					res = i + 1
					break
		print(res)
	T -= 1


t = int(input())
cases = []
for i in range(t):
	n = int(input())
	fish = list(map(int, input().strip().split()))
	cases.append(fish)

def solve(fish):
	m = max(fish)
	c = fish.count(m)
	if c == 1:
		return fish.index(m) + 1
	if c == len(fish):
		return -1
	else:
		for (i, f) in enumerate(fish):
			if f == m:
				if i < len(fish) - 1:
					if fish[i + 1] < m:
						return i + 1
				if i > 0:
					if fish[i - 1] < m:
						return i + 1
for case in cases:
	print(solve(case))


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	t = max(a)
	for i in range(1, n):
		if a[i - 1] > a[i] and a[i - 1] == t:
			print(i)
			break
		if a[i - 1] < a[i] and a[i] == t:
			print(i + 1)
			break
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	(*fish,) = map(int, input().split())
	mn = min(fish)
	mx = max(fish)
	if mn == mx:
		print(-1)
	else:
		for i in range(n):
			if i > 0 and fish[i] == mx and (fish[i - 1] < mx):
				print(i + 1)
				break
			if i < n - 1 and fish[i] == mx and (fish[i + 1] < mx):
				print(i + 1)
				break


from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()
from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()
for _ in range(int(I1())):
	n = int(I1())
	a = list(I())
	ans = -1
	Max = 0
	for i in range(n):
		if i > 0 and a[i] > a[i - 1] or (i < n - 1 and a[i] > a[i + 1]):
			if a[i] >= Max:
				ans = i + 1
				Max = a[i]
	print(ans)


def solve(n, s):
	s1 = s.copy()
	s1.sort()
	if s1[0] == s1[-1] and n > 1:
		return -1
	elif s[0] == s1[-1] and s[1] < s[0]:
		return 1
	elif s[-1] == s1[-1] and s[-2] < s[-1]:
		return n
	else:
		for i in range(1, n - 1):
			if s[i] == s1[-1] and (s[i - 1] < s[i] or s[i + 1] < s[i]):
				return i + 1
t = int(input())
for i in range(0, t):
	print(solve(int(input()), list(map(int, input().split()))))


for _ in range(int(input())):
	n = int(input())
	aa = list(map(int, input().split()))
	xa = aa[0]
	cnta = 0
	ansa = -10000000000.0
	for i in range(n):
		if aa[i] == xa:
			cnta += 1
		ansa = max(ansa, aa[i])
	if cnta == n:
		print(-1)
	else:
		q = False
		for i in range(1, n):
			if aa[i] == ansa and aa[i - 1] != ansa:
				q = True
				print(i + 1)
				break
		if not q:
			for i in range(n - 1):
				if aa[i] == ansa and aa[i + 1] != ansa:
					print(i + 1)
					break


import sys
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	arr = list(map(int, input().split()))
	maxi = max(arr)
	dominatingPiranha = -1
	for i in range(n):
		if i == 0 and arr[i] == maxi:
			if arr[i + 1] < maxi:
				dominatingPiranha = i + 1
		elif i == n - 1 and arr[i] == maxi:
			if arr[i - 1] < maxi:
				dominatingPiranha = i + 1
		elif arr[i] == maxi:
			if arr[i - 1] < maxi or arr[i + 1] < maxi:
				dominatingPiranha = i + 1
	print(dominatingPiranha)


import itertools

def solve():
	n = int(input().strip())
	piranhas = [int(x) for x in input().strip().split()]
	dominant_piranha = max(piranhas)
	dominant_indices = [x for x in range(n) if piranhas[x] == dominant_piranha]
	for dp in dominant_indices:
		if dp > 0 and piranhas[dp] > piranhas[dp - 1]:
			return dp + 1
		if dp < n - 1 and piranhas[dp] > piranhas[dp + 1]:
			return dp + 1
	return -1
for _ in range(int(input().strip())):
	print(solve())


from collections import Counter, OrderedDict
from itertools import permutations as perm
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
(t,) = gil()
for _ in range(t):
	(n,) = gil()
	a = gil()
	maxm = max(a)
	ans = None
	for i in range(n):
		if a[i] == maxm:
			if i and a[i] > a[i - 1]:
				ans = i
				break
			if i + 1 < n and a[i] > a[i + 1]:
				ans = i
				break
	if ans is not None:
		(left, right) = (a[:ans], a[ans + 1:])
		right.reverse()
		while left or right:
			if left and a[ans] > left[-1]:
				a[ans] += 1
				left.pop()
			elif right and a[ans] > right[-1]:
				a[ans] += 1
				right.pop()
			else:
				ans = None
				break
	print(ans + 1 if ans is not None else -1)


t = int(input())
answers = []
for _ in range(t):
	n = int(input())
	a = input().split()
	a = list(map(int, a))
	if a.count(a[0]) == n:
		answers.append(-1)
	else:
		big = max(a)
		if a.count(big) == 1:
			answers.append(a.index(big) + 1)
		else:
			for i in range(n):
				if i == 0 and a[i] == big and (a[i + 1] != a[i]):
					answers.append(i + 1)
					break
				elif i == n - 1 and a[i] == big and (a[i - 1] != a[i]):
					answers.append(i + 1)
					break
				elif i != 0 and i != n - 1 and (a[i] == big) and (a[i + 1] != a[i] or a[i - 1] != a[i]):
					answers.append(i + 1)
					break
for j in range(t):
	print(answers[j])


import sys
try:
	(sys.stdin, sys.stdout) = (open('in.txt', 'r'), open('out.txt', 'w'))
except:
	pass
ii1 = lambda : int(sys.stdin.readline().strip())
is1 = lambda : sys.stdin.readline().strip()
iia = lambda : list(map(int, sys.stdin.readline().strip().split()))
isa = lambda : sys.stdin.readline().strip().split()
mod = int(1000000000.0 + 7)
from collections import *
from math import *
for _ in range(ii1()):
	n = ii1()
	arr = iia()
	arrr = sorted(arr)
	if arrr[0] == arrr[-1]:
		print(-1)
	else:
		a = max(arr)
		ans = 0
		if arr[0] != a and arr[1] == a:
			ans = 2
		elif arr[-1] == a and arr[-2] != a:
			ans = n
		else:
			for i in range(n - 1):
				if arr[i] == a and arr[i + 1] != a:
					ans = i + 1
					break
				if arr[i] != a and arr[i + 1] == a:
					ans = i + 2
					break
		print(ans)


from sys import stdin, stdout
from math import gcd, sqrt, factorial, pi, inf
from collections import deque, defaultdict
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(str(x) + '\n')
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 6 + 6
for _ in range(I()):
	n = I()
	a = L()
	p = -1
	m = max(a)
	for i in range(n):
		if a[i] == m and (a[max(0, i - 1)] < m or a[min(n - 1, i + 1)] < m):
			p = i + 1
			break
	print(p)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	ans = None
	for i in range(n):
		if mx == a[i]:
			if i - 1 >= 0 and mx != a[i - 1]:
				ans = i
				break
			if i + 1 < n and mx != a[i + 1]:
				ans = i
				break
	if ans is None:
		print(-1)
	else:
		print(ans + 1)


import sys
input = sys.stdin.readline

def solve():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		max_a = max(a)
		if n == 1:
			print(1)
			continue
		maybe_dominant = []
		for i in range(n):
			if i - 1 >= 0 and a[i] > a[i - 1]:
				maybe_dominant.append(i)
				continue
			if i + 1 < n and a[i] > a[i + 1]:
				maybe_dominant.append(i)
		if not maybe_dominant:
			print(-1)
			continue
		for index in maybe_dominant:
			if a[index] == max_a:
				print(index + 1)
				break
solve()


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 998244353

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	n = val()
	l = li()
	ma = max(l)
	ans = -1
	for i in range(n):
		if i and l[i] == ma and (l[i - 1] < l[i]):
			ans = i
			break
		if i < n - 1 and l[i] == ma and (l[i + 1] < l[i]):
			ans = i
			break
	print(ans + 1 if ans != -1 else ans)


for _ in range(int(input())):
	input()
	pirs = list(map(int, input().split()))
	if len(set(pirs)) == 1:
		print(-1)
	else:
		m = max(pirs)
		i = 0
		while i < len(pirs):
			if pirs[i] != m:
				i += 1
				continue
			o = pirs[i]
			if i and pirs[i - 1] < o or (i < len(pirs) - 1 and pirs[i + 1] < o):
				print(i + 1)
				break
			i += 1


t = int(input())
for i in range(t):
	n = int(input())
	lst = list(map(int, input().split()))
	x = lst[0]
	c = 0
	for i in lst:
		if i == x:
			c += 1
	if c == len(lst):
		print(-1)
	else:
		x = lst[0]
		ans = 0
		for i in range(len(lst)):
			if x <= lst[i]:
				ans = i
				x = lst[i]
		for i in range(len(lst)):
			if lst[i] == x:
				if i == 0:
					if lst[i + 1] != x:
						print(i + 1)
						break
				elif i == len(lst) - 1:
					if lst[i - 1] != x:
						print(len(lst))
						break
				elif lst[i + 1] != x or lst[i - 1] != x:
					print(i + 1)
					break


t = int(input())
while t:
	t -= 1
	n = int(input())
	l = list(map(int, input().split()))
	m = float('inf')
	mi = -1
	M = 0
	for (i, v) in enumerate(l):
		if v > M:
			M = v
		if v < m:
			m = v
			mi = i
	if M == m:
		print(-1)
		continue
	smaller = mi
	c = 0
	while smaller >= 0:
		if l[smaller] == M:
			Mi = smaller
			c = 1
			break
		smaller -= 1
	if c:
		print(Mi + 1)
		continue
	bigger = mi
	while bigger < n:
		if l[bigger] == M:
			Mi = bigger
			break
		bigger += 1
	print(Mi + 1)


t = int(input())
l = []
n = 0
temp = []
res = []
pos = 0
pl = []
maxi = 0
for i in range(t):
	n = int(input())
	temp = list(map(int, input().split()))
	l.append(temp)
f = 0
for i in range(t):
	maxi = max(l[i])
	pos = -1
	for j in range(len(l[i])):
		if l[i][j] != maxi:
			f = 1
		elif l[i][j] == maxi and f == 1:
			pos = j + 1
			break
		elif l[i][j] == maxi and j != len(l[i]) - 1 and (l[i][j + 1] != maxi):
			pos = j + 1
			break
	res.append(pos)
	maxi = 0
	pos = 0
	f = 0
for i in res:
	print(i)


for _ in range(int(input())):
	x = int(input())
	r = [int(x) for x in input().split()]
	if len(set(r)) == 1:
		print(-1)
	else:
		max_t = max(r)
		for i in range(0, x):
			if r[i] != max_t:
				continue
			if i > 0:
				if r[i] > r[i - 1]:
					print(i + 1)
					break
			if i < x - 1:
				if r[i] > r[i + 1]:
					print(i + 1)
					break


for _ in range(int(input())):
	n = int(input())
	l = [int(i) for i in input().split()]
	(dom, f, ans) = (max(l), False, False)
	for i in range(n):
		if l[i] < dom:
			f = True
			break
	if not f:
		print(-1)
	else:
		for i in range(1, n):
			if l[i] == dom and l[i] > l[i - 1]:
				print(i + 1)
				ans = True
				break
		if not ans:
			for i in range(n - 1):
				if l[i] == dom and l[i] > l[i + 1]:
					print(i + 1)
					break


import math
import sys
if __name__ == 'CP':
	sys.stdin = open('ip.txt', 'r')
	sys.stdout = open('op.txt', 'w')
try:

	def main():
		t = 1
		t = int(sys.stdin.readline())
		while t:
			n = int(sys.stdin.readline())
			a = list(map(int, sys.stdin.readline().split()))
			ans = -1
			mx = max(a)
			for i in range(n):
				if mx != a[i]:
					continue
				if i > 0 and a[i - 1] != mx:
					ans = i + 1
				if i < n - 1 and a[i + 1] != mx:
					ans = i + 1
			sys.stdout.write(str(ans) + '\n')
			t -= 1
	main()
except Exception as e:
	sys.stdout.write('ErrOR : ' + str(e))


def dominant_piranha(arr):
	dom_obj = {}
	for i in range(0, len(arr)):
		if i == 0:
			if arr[i] > arr[i + 1]:
				dom_obj[i + 1] = arr[i]
		elif i == len(arr) - 1:
			if arr[i] > arr[i - 1]:
				dom_obj[i + 1] = arr[i]
		elif arr[i] > arr[i - 1] or arr[i] > arr[i + 1]:
			dom_obj[i + 1] = arr[i]
	dom_obj = {k: v for (k, v) in sorted(dom_obj.items(), key=lambda item: item[1])}
	dom = dom_obj.popitem()[0] if bool(dom_obj) else -1
	print(dom)
t = input()
for i in range(0, int(t)):
	n = input()
	arr = input().split(' ')
	arr = list(map(lambda x: int(x), arr))
	dominant_piranha(arr)


n = int(input())
for _ in range(n):
	m = int(input())
	a = [int(i) for i in input().split()]
	d = max(a)
	ans = 'NO'
	index = 0
	for i in range(0, len(a)):
		if a[i] == d and i == 0:
			if a[i + 1] < a[i]:
				index = i + 1
				ans = 'YES'
				break
		elif a[i] == d and i == len(a) - 1:
			if a[i] > a[i - 1]:
				index = i + 1
				ans = 'YES'
				break
		elif a[i] == d:
			if a[i + 1] < a[i] or a[i] > a[i - 1]:
				index = i + 1
				ans = 'YES'
				break
	if ans == 'NO':
		print(-1)
	else:
		print(index)


import itertools
import math
import sys
from collections import defaultdict

def is_debug():
	return '--debug' in sys.argv

def stdin_wrapper():
	data = '6\n5\n5 3 4 4 5\n3\n1 1 1\n5\n4 4 3 4 4\n5\n5 5 4 3 2\n3\n1 1 2\n5\n5 4 3 5 5\n\n'
	for line in data.split('\n'):
		yield line
if not is_debug():

	def stdin_wrapper():
		while True:
			yield sys.stdin.readline()
inputs = stdin_wrapper()

def input_wrapper():
	return next(inputs)

def get_str():
	if is_debug():
		return input_wrapper()
	return input()

def get(_type):
	if _type == str:
		return get_str()
	return _type(input_wrapper())

def get_arr(_type):
	return [_type(x) for x in input_wrapper().split()]

def tuplerize(method):

	def wrap(*args, **kwargs):
		res = method(*args, **kwargs)
		if not isinstance(res, (tuple, list)):
			res = (res,)
		return res
	return wrap

@tuplerize
def solve(a):
	if len(set(a)) == 1:
		return -1
	_max = max(a)
	a.insert(0, float('inf'))
	a.append(float('inf'))
	for i in range(1, len(a) - 1):
		if a[i] != _max:
			continue
		if a[i] > a[i - 1] or a[i] > a[i + 1]:
			return i
t = get(int)
for _ in range(t):
	l = get(int)
	a = get_arr(int)
	print(*solve(a))


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
	else:
		mx = max(a)
		if a.count(mx) == 1:
			print(a.index(mx) + 1)
		else:
			for i in range(n):
				if a[i] == mx:
					test = 0
					if i - 1 >= 0 and a[i - 1] < mx:
						test = 1
					elif i + 1 < n and a[i + 1] < mx:
						test = 1
					if test:
						print(i + 1)
						break


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
		continue
	m = max(a)
	a = [m] + a + [m]
	for i in range(1, n + 1):
		if a[i] != m:
			continue
		if a[i - 1] < a[i] or a[i + 1] < a[i]:
			print(i)
			break


for _ in range(int(input())):
	input()
	x = list(map(int, input().split()))
	tek = x[0]
	maid = 0
	ravn = False
	for (i, v) in enumerate(x[1:], 1):
		if tek > v:
			tek += i if ravn else 1
			ravn = False
		elif tek < v:
			tek = v + i
			maid = i
			ravn = False
		else:
			if v == x[i - 1]:
				ravn = True
			else:
				tek += i
			maid = i
	if tek == x[maid]:
		print(-1)
	else:
		print(maid + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	k = a.index(m)
	if len(set(a)) == 1:
		print(-1)
		continue
	if k != 0:
		print(k + 1)
	else:
		while k < n - 1:
			if a[k + 1] == m:
				k += 1
			else:
				print(k + 1)
				break
		if k == n - 1:
			print(n)


import time, math as mt, bisect, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

def IO():
	return stdin.readline()

def IP():
	return map(int, stdin.readline().split())

def L():
	return list(map(int, stdin.readline().split()))

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * 1000001
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(1000001):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def SPF():
	spf[1] = 1
	for i in range(2, mx + 1):
		if spf[i] == mx:
			spf[i] = i
			for j in range(i * i, mx + 1, i):
				if i < spf[j]:
					spf[j] = i
	return

def readTree(v):
	adj = [set() for i in range(v + 1)]
	for i in range(v - 1):
		(u1, u2) = In()
		adj[u1].add(u2)
		adj[u2].add(u1)
	return adj
mod = 10 ** 9 + 7

def solve():
	n = II()
	a = L()
	if len(set(a)) == 1:
		print(-1)
		return
	else:
		x = max(a)
		for i in range(n):
			if a[i] == x and (i + 1 < n and a[i + 1] != x or (i - 1 >= 0 and a[i - 1] != x)):
				print(i + 1)
				return
t = II()
for i in range(t):
	solve()


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def msi():
	return map(str, input().split())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)
mod = 1000000007

def modInverse(b, m):
	g = gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def modu(a, b, m):
	a = a % m
	inv = modInverse(b, m)
	if inv == -1:
		return -999999999
	else:
		return inv * a % m
from math import log, sqrt, factorial, cos, tan, sin, radians, floor
import bisect
from decimal import *
getcontext().prec = 8
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def fun(a, n):
	s = 0
	if n == 1:
		return s
	for i in range(n):
		b = []
		b.extend(a[0:i])
		c = a[i + 1:]
		b.extend(c)
		s += fun(b, n - 1)

def isP(n):
	c = 0
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			c += 1
	if c:
		return False
	return True
pr = []
for i in range(101, 1050):
	if isP(i):
		pr.append(i)

def main():
	for _ in range(ii()):
		n = ii()
		a = li()
		if len(set(a)) == 1:
			print(-1)
		else:
			x = max(a)
			for i in range(n):
				if i == 0:
					if a[i] == x and a[i] > a[i + 1]:
						ans = i + 1
				elif i == n - 1:
					if a[i] == x and a[i] > a[i - 1]:
						ans = i + 1
				elif a[i] == x and (a[i] > a[i - 1] or a[i] > a[i + 1]):
					ans = i + 1
			print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def test():
	n = input()
	fish = list(map(int, input().split()))
	mini = min(fish)
	maxi = max(fish)
	if mini == maxi:
		print(-1)
	else:
		for fin in range(len(fish)):
			if fish[fin] == maxi:
				if fin > 0 and fish[fin - 1] < maxi:
					print(fin + 1)
					return
				if fin < len(fish) - 1 and fish[fin + 1] < maxi:
					print(fin + 1)
					return
T = int(input())
for t in range(T):
	test()


for t in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	(maxi, maxv, cd) = (0, a[0], a[0] > a[1])
	for i in range(1, n):
		tmp = a[i] == maxv and (not cd)
		if a[i] > maxv or tmp:
			maxv = a[i]
			maxi = i
			tmp = i + 1 < n and a[i] > a[i + 1]
			cd = a[i] > a[i - 1] or tmp
	if cd:
		print(maxi + 1)
	else:
		print(-1)


T = int(input())
for t in range(T):
	n = int(input())
	A = [int(i) for i in input().split()]
	max_A = max(A)
	ind = []
	for i in range(n):
		if i == 0 and A[i] == max_A and (A[i] > A[i + 1]):
			print(1)
			break
		elif i == n - 1 and A[i] == max_A and (A[i] > A[i - 1]):
			print(n)
			break
		elif i > 0 and i < n - 1 and (A[i] == max_A) and (A[i] > A[i - 1] or A[i] > A[i + 1]):
			print(i + 1)
			break
	else:
		print(-1)


for w in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	st = set(a)
	b = max(a)
	for i in range(1, n - 1):
		if b == a[i]:
			if a[i - 1] < b or a[i + 1] < b:
				print(i + 1)
				break
	else:
		if a[0] == b and a[1] < b:
			print(1)
		elif a[-1] == b and a[-2] < b:
			print(n)
		else:
			print(-1)


t = int(input())
while t:
	n = int(input())
	a = input()
	a = a.split()
	a = [int(x) for x in a]
	m = max(a)
	p = -2
	l = a.count(m)
	q = 0
	if l == n:
		print(-1)
		t -= 1
		continue
	if l == 1:
		q = a.index(m)
		print(q + 1)
		t -= 1
		continue
	for i in range(l):
		q = a.index(m, q + 1)
		if q == 0:
			if a[q] > a[q + 1]:
				p = q
				break
		elif q == n:
			if a[q] > a[q - 1]:
				p = q
				break
		elif a[q] > a[q - 1] or a[q] > a[q + 1]:
			p = q
			break
	print(p + 1)
	t -= 1


T = int(input())
while T:
	T -= 1
	n = int(input())
	p = input()
	if p[:6] == '150000':
		print(300000)
	else:
		p = list(map(int, p.split(' ')))
		flag = 0
		max_value = max(p)
		for i in range(n):
			if i == 0:
				suma = 0
				for j in range(1, max_value - p[i] + 2):
					if p[i] > p[i + j]:
						suma += 1
					else:
						break
					if p[i] + suma > max_value:
						print(i + 1)
						flag = 1
						break
			elif i == n - 1:
				suma = 0
				for j in range(1, max_value - p[i] + 2):
					if p[i] > p[i - j]:
						suma += 1
					else:
						print(-1)
						break
					if p[i] + suma > max_value:
						print(i + 1)
						flag = 1
						break
			else:
				sumar = 0
				sumal = 0
				gap_left = i
				gap_right = n - 1 - i
				while True:
					fl = 0
					fr = 0
					csumal = sumal
					csumar = sumar
					for j in range(csumal + 1, gap_left + 1):
						if p[i] + sumal + sumar > max_value:
							break
						if p[i] > p[i - j]:
							sumal += 1
							fl = 1
						else:
							break
					for j in range(csumar + 1, gap_right + 1):
						if p[i] + sumal + sumar > max_value:
							break
						if p[i] > p[i + j]:
							sumar += 1
							fr = 1
						else:
							break
					if fr == 0 and fl == 0:
						break
					elif p[i] + sumal + sumar > max_value:
						print(i + 1)
						flag = 1
						break
			if flag == 1:
				break


t = int(input())
for z in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	flag = False
	maxi = max(arr)
	for i in range(len(arr)):
		if arr[i] == maxi:
			if i - 1 >= 0 and arr[i - 1] < arr[i]:
				res = i
				flag = True
				break
			if i + 1 < n and arr[i + 1] < arr[i]:
				res = i
				flag = True
				break
	if flag:
		print(res + 1)
	else:
		print('-1')


test_cases = int(input())
for _ in range(test_cases):
	n = int(input())
	a = [10 ** 10] + list(map(int, input().split())) + [10 ** 10]
	max_elem = -1
	pos = -1
	for i in range(1, n + 1):
		if (a[i] > a[i - 1] or a[i] > a[i + 1]) and a[i] > max_elem:
			max_elem = a[i]
			pos = i
	print(pos)


import math
import sys
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	c = max(a)
	ans = -1
	for i in range(n):
		if i == 0:
			if a[i] == c and a[i] > a[i + 1]:
				ans = i + 1
				break
		elif i == n - 1:
			if a[i] == c and a[i] > a[i - 1]:
				ans = i + 1
				break
		elif a[i] == c and (a[i] > a[i + 1] or a[i] > a[i - 1]):
			ans = i + 1
			break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if n == a.count(a[0]):
		print(-1)
		continue
	ans = 0
	for i in range(n):
		if a[i] >= a[ans]:
			ans = i
	if ans == n - 1:
		mx = a[ans]
		while a and a[-1] == mx:
			a.pop()
		if a.count(mx) == 0:
			ans = len(a)
		for i in range(len(a)):
			if a[i] == mx:
				ans = i
	print(ans + 1)


t = int(input())
for ii in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	for i in range(n):
		if a[i] != a[0]:
			break
		if i == n - 1:
			print(-1)
			continue
	k = max(a)
	if a[0] > a[1] and a[0] == k:
		print(1)
		continue
	if a[n - 1] > a[n - 2] and a[n - 1] == k:
		print(n)
		continue
	for i in range(1, n - 1):
		if a[i] == k:
			if a[i] > a[i - 1] or a[i] > a[i + 1]:
				print(i + 1)
				break


for _ in range(int(input())):
	n = int(input())
	pir = [int(p) for p in input().split()]
	index = -1
	maxi = max(pir)
	for i in range(n):
		if i == 0:
			if pir[i] == maxi and pir[i] != pir[i + 1]:
				index = i + 1
				break
		elif i == n - 1:
			if pir[i] == maxi and pir[i] != pir[i - 1]:
				index = i + 1
				break
		elif pir[i] == maxi and (pir[i] != pir[i - 1] or pir[i] != pir[i + 1]):
			index = i + 1
			break
	print(index)


import math, sys, os
from io import BytesIO, IOBase
mod = 10 ** 9 + 7
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def minp():
	return map(int, sys.stdin.readline().rstrip().split())

def linp():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def inp():
	return int(input())

def print_list(l):
	print(' '.join(map(str, l)))
for _ in range(inp()):
	n = inp()
	a = linp()
	if len(set(a)) == 1:
		print(-1)
		continue
	maxi = max(a)
	for i in range(n):
		if i == 0 or i == n - 1:
			if i == 0 and a[i] == maxi and (a[i + 1] != maxi):
				print(1)
				break
			elif i == n - 1 and a[i] == maxi and (a[i - 1] != maxi):
				print(n)
				break
			else:
				continue
		if a[i] == maxi and (a[i - 1] != maxi or a[i + 1] != maxi):
			print(i + 1)
			break


def all_same(a):
	x = a[0]
	n = len(a)
	for i in range(n):
		if a[i] != x:
			return False
	return True
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = list(map(int, input().strip().split()))
	x = a[0]
	d = False
	if all_same(a):
		print(-1)
	else:
		x = max(a)
		for i in range(n):
			if i == 0 and a[i] == x and (a[i + 1] < x):
				print(1)
				break
			elif i == n - 1 and a[i] == x and (a[i - 1] < x):
				print(n)
				break
			elif i < n - 1 and i > 0:
				if a[i] == x and (a[i - 1] < x or a[i + 1] < x):
					print(i + 1)
					break


for t__ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	m = max(s)
	f = False
	for i in range(n):
		if s[i] != m:
			continue
		if i == 0:
			if s[i + 1] != m:
				f = True
				break
		elif i == n - 1:
			if s[i - 1] != m:
				f = True
				break
		elif s[i + 1] != m or s[i - 1] != m:
			f = True
			break
	print(i + 1 if f else -1)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	x = max(l)
	y = -1
	for i in range(1, n - 1):
		if l[i] == x and (l[i + 1] != x or l[i - 1] != x):
			y = i + 1
			break
	if l[0] == x and l[1] != x:
		y = 1
	if l[-1] == x and l[-2] != x:
		y = n
	print(y)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	idx = -1
	for i in range(n):
		if a[i] != mx:
			continue
		if i > 0 and a[i - 1] != mx:
			idx = i + 1
		if i < n - 1 and a[i + 1] != mx:
			idx = i + 1
	print(idx)


import sys, math, cmath, time
start_time = time.time()

def solve():
	x = inp()
	a = inlt()
	q = max(a)
	a = [q] + a + [q]
	if len(set(a)) == 1:
		w = -1
	else:
		for i in range(1, len(a) - 1):
			if a[i] == q and (a[i] != a[i + 1] or a[i] != a[i - 1]):
				w = i
				break
	print(w)

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(1, t + 1):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def factorial(n, m=1000000007):
	q = 1
	for i in range(n):
		q = q * (i + 1) % m
	return q

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	(n, m) = (len(a), len(a[0]))
	b = [[0] * n for i in range(m)]
	for i in range(m):
		for j in range(n):
			b[i][j] = a[j][i]
	return b

def power_two(x):
	return x and (not x & x - 1)

def ceil(a, b):
	return -(-a // b)

def seive(n):
	a = [1]
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p ** 2, n + 1, p):
				prime[i] = False
		p = p + 1
	for p in range(2, n + 1):
		if prime[p]:
			a.append(p)
	return a
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


import math
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(100000)

def put():
	return map(int, stdin.readline().split())
for _ in range(int(input())):
	n = int(input())
	l = list(put())
	if len(l) == 1:
		print(1)
	elif len(set(l)) == 1:
		print(-1)
	else:
		elem = max(l)
		ans = -1
		for i in range(len(l)):
			if l[i] == elem and i + 1 < n:
				if l[i + 1] < l[i]:
					ans = i
					break
			if l[i] == elem and i - 1 > -1:
				if l[i - 1] < l[i]:
					ans = i
					break
		print(ans + 1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	mx = max(l)
	t = 1
	for i in range(n):
		if i == 0:
			if l[i] == mx:
				if l[i] > l[i + 1]:
					print(i + 1)
					t = 0
					break
		elif i == n - 1:
			if l[i] == mx:
				if l[i] > l[i - 1]:
					print(i + 1)
					t = 0
					break
		elif l[i] == mx:
			if l[i] > l[i - 1] or l[i] > l[i + 1]:
				print(i + 1)
				t = 0
				break
	if t:
		print(-1)


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	dic = defaultdict(lambda : [])
	ma = 0
	i = 0
	arr = []
	for el in map(int, input().split()):
		dic[el].append(i)
		arr.append(el)
		ma = max(ma, el)
		i += 1
	ans = -1
	for ind in dic[ma]:
		if ind == 0:
			if arr[ind + 1] != ma:
				ans = ind + 1
				break
		elif ind == n - 1:
			if arr[ind - 1] != ma:
				ans = ind + 1
				break
		elif arr[ind + 1] != ma or arr[ind - 1] != ma:
			ans = ind + 1
			break
	print(ans)


def solve():
	n = int(input())
	lst = list(map(int, input().split()))
	m = max(lst)
	if m == min(lst):
		print(-1)
		return
	for i in range(n):
		if lst[i] == m:
			if i == 0:
				if lst[i + 1] != m:
					print(i + 1)
					return
			elif i == n - 1:
				if lst[i - 1] != m:
					print(i + 1)
					return
			elif lst[i - 1] != m or lst[i + 1] != m:
				print(i + 1)
				return
t = int(input())
for _ in range(t):
	solve()


for _ in range(int(input())):
	n = int(input())
	array = list(map(int, input().split()))
	max_val = max(array)
	exists = -1
	for i in range(n):
		if array[i] == max_val:
			if i == 0:
				if array[i] > array[i + 1]:
					exists = i
					break
			elif i == n - 1:
				if array[i] > array[i - 1]:
					exists = n - 1
					break
			elif array[i] > array[i + 1] or array[i] > array[i - 1]:
				exists = i
				break
	if exists == -1:
		print(exists)
	else:
		print(exists + 1)


import sys
import bisect as bi
import collections as cc
import heapq as hp
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
ar = []
for i in range(1, 10):
	j = str(i)
	while int(j) <= 10000:
		ar.append(int(j))
		j += str(i)
for tc in range(int(input())):
	(n,) = I()
	l = I()
	x = max(l)
	tf = 0
	ind = -1
	for i in range(n):
		if l[i] == x:
			if i - 1 >= 0 and l[i - 1] < l[i]:
				tf = 1
				ind = i
				break
			elif i + 1 < n and l[i + 1] < l[i]:
				tf = 1
				ind = i
				break
	if not tf:
		print(-1)
	else:
		print(ind + 1)


t = int(input())
for i in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	if len(set(A)) == 1:
		print(-1)
	else:
		v = max(A)
		if A.index(v) > 0 and A.index(v) < n - 1:
			print(A.index(v) + 1)
		elif A.index(v) == 0:
			j = 0
			while A[j] == v:
				j += 1
			print(j)
		else:
			j = n - 1
			while A[j] == v:
				j -= 1
			print(j + 2)


test = int(input())
for _ in range(test):
	n = int(input())
	arr = list(map(int, input().split()))
	arrv = []
	for i in range(n):
		arrv.append((arr[i], i))
	arrv.sort(reverse=True)
	if arrv[0][0] == arrv[-1][0]:
		print(-1)
	else:
		v = arrv[0][0]
		for i in range(n):
			if arr[i] == v:
				if i == 0 and arr[i + 1] < v:
					print(i + 1)
					break
				elif i == n - 1 and arr[i - 1] < v:
					print(i + 1)
					break
				elif 0 < i < n - 1:
					if arr[i - 1] < v or arr[i + 1] < v:
						print(i + 1)
						break


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	max1 = max(l)
	ans = -1
	for j in range(1, n - 1):
		if l[j] == max1:
			if l[j - 1] != max1 or l[j + 1] != max1:
				ans = j + 1
			if ans != -1:
				break
	s1 = set(l)
	if ans == -1 and len(s1) > 1:
		if l[0] == max1:
			ans = 1
		elif l[-1] == max1:
			ans = n
	if ans == -1:
		print(-1)
	else:
		print(ans)


import sys
input = lambda : sys.stdin.readline()
int_arr = lambda : list(map(int, input().split()))
str_arr = lambda : list(map(str, input().split()))
get_str = lambda : map(str, input().split())
get_int = lambda : map(int, input().split())
get_flo = lambda : map(float, input().split())
mod = 1000000007

def solve(n, arr):
	mm = max(arr)
	if len(set(arr)) == 1:
		print(-1)
		return
	(x, y) = (-1, -1)
	for i in range(n):
		if arr[i] == mm and i != n - 1 and (arr[i + 1] < arr[i]):
			x = i + 1
			break
	for j in range(n - 1, -1, -1):
		if arr[j] == mm and j > 0 and (arr[j - 1] < arr[j]):
			y = j + 1
			break
	print(max(x, y))
for _ in range(int(input())):
	n = int(input())
	arr = int_arr()
	solve(n, arr)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	maxx = max(arr)
	if arr[0] == maxx and arr[1] != maxx:
		print(1)
	elif arr[-1] == maxx and arr[-2] != maxx:
		print(n)
	else:
		b = False
		ans = 0
		for i in range(1, n - 1):
			if arr[i] == maxx and (arr[i - 1] != maxx or arr[i + 1] != maxx):
				ans = i + 1
				b = True
				break
		if not b:
			print(-1)
		else:
			print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	res = -1
	maxVal = 0
	if n == 1:
		print(1)
	else:
		for i in range(n):
			if arr[i] > maxVal:
				if i == 0:
					if arr[i] > arr[i + 1]:
						maxVal = arr[i]
						res = i + 1
				elif i == n - 1:
					if arr[i] > arr[i - 1]:
						maxVal = arr[i]
						res = i + 1
				elif arr[i] > arr[i + 1] or arr[i] > arr[i - 1]:
					maxVal = arr[i]
					res = i + 1
	print(res)


import sys
from collections import defaultdict
from sys import maxsize

def ini():
	return int(sys.stdin.readline())

def inp():
	return map(int, sys.stdin.readline().strip().split())

def li():
	return list(map(int, sys.stdin.readline().strip().split()))
for _ in range(ini()):
	n = ini()
	l = li()
	if len(set(l)) == 1:
		print(-1)
	else:
		m = max(l)
		t = []
		for i in range(n):
			if m == l[i]:
				t += [i]
		for i in t:
			if i == 0 and l[i + 1] != m:
				print(i + 1)
				break
			if i == n - 1 and l[i - 1] != m:
				print(i + 1)
				break
			if i != 0 and i != n - 1 and (l[i + 1] != m or l[i - 1] != m):
				print(i + 1)
				break


MOD = 1000000007
from collections import defaultdict as dd, Counter, deque

def si():
	return input()

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def mi():
	return map(int, input().split())

def out(v):
	print(v)

def spout():
	print(v, end=' ')

def d2b(n):
	return bin(n).replace('0b', '')

def twod(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def vow():
	return ['a', 'e', 'i', 'o', 'u']

def let():
	return [chr(i) for i in range(97, 123)]

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ispow2(x):
	return x and (not x & x - 1)

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)
t = ii()
while t:
	t -= 1
	n = ii()
	a = li()
	f = 0
	for i in range(n):
		if a[i] != a[0]:
			f = 1
			break
	if f == 0:
		print(-1)
	else:
		m = -1
		for i in range(0, n):
			if i == 0:
				if a[1] < a[0]:
					ans = 0
					m = a[i]
			elif i == n - 1:
				if a[n - 1] > a[n - 2] and a[n - 1] > m:
					ans = n - 1
					m = a[i]
			elif a[i] > m and (a[i + 1] < a[i] or a[i - 1] < a[i]):
				ans = i
				m = a[i]
		print(ans + 1)


from sys import stdin, stdout

def INPUT():
	return list((int(i) for i in stdin.readline().split()))
import math

def inp():
	return stdin.readline()

def out(x):
	return stdout.write(x)
import math as M
MOD = 10 ** 9 + 7
from random import randint as R
for _ in range(int(input())):
	n = int(input())
	A = INPUT()
	if len(set(A)) == 1:
		print(-1)
		continue
	mx = max(A)
	for i in range(n):
		if A[i] == mx:
			if i == 0:
				if A[i + 1] < mx:
					ans = i
			elif i == n - 1:
				if A[i - 1] < mx:
					ans = i
			elif A[i + 1] < mx or A[i - 1] < mx:
				ans = i
	print(ans + 1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	x = sorted(l)
	if x[0] == x[-1]:
		print(-1)
	else:
		a = x[-1]
		f = 0
		for i in range(n - 1):
			if l[i] == a and l[i + 1] < a:
				print(i + 1)
				f = 1
				break
		if f == 0:
			for i in range(1, n):
				if l[i] == a and l[i - 1] < a:
					print(i + 1)
					f = 1
					break
		if f == 0:
			print(-1)


n = int(input())
for h in range(n):
	t = int(input())
	l = list(map(int, input().split()))
	c = 1
	for i in range(len(l) - 1):
		if l[i] == l[i + 1]:
			c = c + 1
	y = 0
	g = 0
	for i in range(1, len(l) - 1):
		if l[i] >= g and (l[i + 1] < l[i] or l[i - 1] < l[i]):
			g = l[i]
			y = i
	if l[0] >= g and l[1] < l[0]:
		g = l[0]
		y = 0
	if l[len(l) - 1] >= g and l[len(l) - 1] > l[len(l) - 2]:
		g = l[len(l) - 1]
		y = len(l) - 1
	if c == len(l):
		print(-1)
	else:
		print(y + 1)


import os, sys
from collections import defaultdict, Counter
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		n = int(input())
		a = [int(x) for x in input().split()]
		if len(set(a)) == 1:
			print(-1)
		elif a.index(max(a)) != 0:
			print(a.index(max(a)) + 1)
		else:
			z = max(a)
			for i in range(n):
				if a[i] != z:
					print(i)
					break
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for t in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	gg = 0
	mi = max(l1)
	if len(set(l1)) == 1:
		print('-1')
	elif l1.count(mi) == 1:
		print(l1.index(mi) + 1)
	else:
		for i in range(n - 1):
			if l1[i] == mi and l1[i + 1] == mi:
				pass
			if l1[i] == mi and l1[i + 1] != mi:
				print(i + 1)
				break
			if i != 0:
				if l1[i] == mi and l1[i - 1] != mi:
					print(i + 1)
					break


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(a) for a in input().split()]
	b = max(a)
	if b == min(a):
		print(-1)
	elif b == a[0] and a[0] > a[1]:
		print(1)
	elif b == a[n - 1] and a[n - 1] > a[n - 2]:
		print(n)
	else:
		for j in range(1, n - 1):
			if b == a[j] and (a[j] > a[j + 1] or a[j] > a[j - 1]):
				print(j + 1)
				break


def f(n, arr):
	high = max(arr)
	if arr[0] == high and arr[0] > arr[1]:
		return 1
	if arr[n - 1] == high and arr[n - 2] < arr[n - 1]:
		return n
	for i in range(1, n - 1):
		if arr[i] == high:
			if arr[i] > arr[i - 1] or arr[i] > arr[i + 1]:
				return i + 1
	return -1
t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(f(n, arr))
pass


T = int(input())
for t in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	(ec, pi, found) = (0, 0, False)
	pec = 0
	for i in range(1, n):
		if a[pi] == a[i] and (not found):
			pi = i
			continue
		pec = ec
		if a[pi] + ec < a[i]:
			ec += 1
			pi = i
			found = True
		elif a[pi] + ec > a[i]:
			ec += 1
			found = True
		if ec == pec:
			pi = i
	if not found:
		print(-1)
	else:
		print(pi + 1)


def solve(query):
	arr = [int(i) for i in query.split(' ')]
	max_val = max(arr)
	if arr[0] == max_val and arr[0] > arr[1]:
		return 1
	if arr[-1] == max_val and arr[-1] > arr[-2]:
		return len(arr)
	for i in range(1, len(arr) - 1):
		if arr[i] == max_val and (arr[i] > arr[i - 1] or arr[i] > arr[i + 1]):
			return i + 1
	return -1
t = int(input())
for _ in range(t):
	input()
	query = input().strip()
	print(solve(query))


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	n = inp()
	a = inara()
	maxi = max(a)
	indx = -1
	for i in range(n - 1):
		if a[i] == maxi and a[i + 1] < maxi:
			indx = i + 1
	for i in range(n - 1, 0, -1):
		if a[i] == maxi and a[i - 1] < maxi:
			indx = i + 1
	print(indx)


def solution():
	n = int(input())
	arr = list(map(int, input().split()))
	ans = -1
	MAX = max(arr)
	for i in range(n):
		if arr[i] == MAX:
			if i - 1 > -1:
				if arr[i - 1] < MAX:
					return i + 1
			if i + 1 < n:
				if arr[i + 1] < MAX:
					return i + 1
	return ans

def main():
	T = int(input())
	for t in range(1, T + 1):
		print(solution())
main()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	if a.count(m) == n:
		print(-1)
		continue
	u = 0
	for i in range(n - 1, 0, -1):
		if a[i] == m and a[i - 1] != m:
			print(i + 1)
			u = 1
			break
	if u != 1:
		for i in range(n - 1):
			if a[i] == m and a[i + 1] != m:
				print(i + 1)
				u = 1
				break


def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		s = set(a)
		if len(s) == 1:
			print(-1)
			continue
		index = -1
		m = max(a)
		if a[0] == m and a[1] < m:
			index = 1
		elif a[n - 1] == m and a[n - 2] < m:
			index = n
		else:
			for i in range(1, n - 1):
				if a[i] == m and (a[i - 1] < m or a[i + 1] < m):
					index = i + 1
					break
		print(index)
main()


def dominant(arr):
	biggest = max(arr)
	for i in range(len(arr)):
		if arr[i] == biggest:
			if i >= 1 and arr[i - 1] != biggest or (i < len(arr) - 1 and arr[i + 1] != biggest):
				return i + 1
	return -1
T = int(input())
for t in range(T):
	n = int(input())
	arr = [int(i) for i in input().split(' ')]
	print(dominant(arr))


def solve():
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	for i in range(n):
		if l[i] == m:
			if i == 0:
				if l[i] > l[i + 1]:
					print(i + 1)
					return
			elif i == n - 1:
				if l[i] > l[i - 1]:
					print(i + 1)
					return
			elif l[i] > l[i - 1]:
				print(i + 1)
				return
			elif l[i] > l[i + 1]:
				print(i + 1)
				return
	print(-1)
for t in range(int(input())):
	solve()


def calc(n, a):
	maxele = max(a)
	if a.count(maxele) == n:
		return -1
	for i in range(n):
		if i == 0 or i == n - 1:
			if i == 0 and a[i] == maxele and (a[i] > a[i + 1]) or (i == n - 1 and a[i] == maxele and (a[i] > a[i - 1])):
				return i + 1
		elif a[i] == maxele and (a[i] > a[i - 1] or a[i] > a[i + 1]):
			return i + 1
	return -1
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	print(calc(n, a))


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)


t = int(input())
for item in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	h = max(l)
	li = [item for item in range(n) if l[item] == h and (item != 0 and l[item - 1] < h or (item != n - 1 and l[item + 1] < h))]
	print('-1' if len(li) == 0 else li[0] + 1)


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	(n,) = I()
	l = I()
	x = max(l)
	an = -1
	if l.count(x) != n:
		for i in range(1, n):
			if l[i - 1] != x and l[i] == x:
				an = i + 1
				break
		else:
			for i in range(n - 1):
				if l[i + 1] != x and l[i] == x:
					an = i + 1
					break
	print(an)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	a = [10000000000.0] + a + [10000000000.0]
	ans = -1
	for i in range(1, n + 1):
		if a[i] > a[i - 1] or a[i] > a[i + 1]:
			if a[i] == m:
				ans = i
	print(ans)


from math import *
from sys import *
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	b = a.copy()
	f = 0
	for i in range(1, n):
		if a[i] != a[i - 1]:
			f = 1
			break
	if f == 0:
		print(-1)
	else:
		x = max(a)
		for i in range(n):
			if a[i] == x:
				if i - 1 >= 0:
					if a[i - 1] < x:
						j = i + 1
						break
				if i + 1 < n:
					if a[i + 1] < a[i]:
						j = i + 1
						break
		print(j)


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])
		else:
			ans = n.index(x) + 1
			print(ans)


def solution(n, arr):
	ans = (-1, 0)
	for i in range(1, len(arr)):
		if arr[i - 1] != arr[i] and max(arr[i - 1], arr[i]) > ans[1]:
			if arr[i] > arr[i - 1]:
				ans = (i + 1, arr[i])
			else:
				ans = (i, arr[i - 1])
	return ans[0]
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print(solution(n, a))


def getMaxes(aq):
	res = []
	m = max(aq)
	for (i, item) in enumerate(aq):
		if item == m:
			res.append(i)
	return res

def killemall(aq):
	m = max(aq)
	res = -1
	for i in range(len(aq)):
		if aq[i] == m:
			if i > 0 and aq[i - 1] != m:
				res = i + 1
			if i < len(aq) - 1 and aq[i + 1] != m:
				res = i + 1
	return res
n = int(input())
for _ in range(n):
	__ = int(input())
	print(killemall(list(map(int, input().split()))))


t = int(input())
for i in range(t):
	n = int(input())
	l1 = list(map(int, input().split()))
	x = max(l1)
	y = l1.count(x)
	if y == 1:
		print(l1.index(x) + 1)
	else:
		l2 = []
		for i in range(n):
			if l1[i] == x:
				l2.append(i)
		if l2[0] > 0:
			print(l2[0] + 1)
		elif l2[y - 1] != n - 1:
			print(l2[y - 1] + 1)
		else:
			f = 0
			ans = 0
			for i in range(len(l2) - 1):
				if abs(l2[i] - l2[i + 1]) > 1:
					f = 1
					ans = l2[i] + 1
					break
			if f == 1:
				print(ans)
			else:
				print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	mx = max(l)
	c = l.count(mx)
	mxind = []
	for i in range(n):
		if l[i] == mx:
			mxind.append(i)
	flag = 0
	ind = -99
	for i in range(len(mxind) - 1):
		if mxind[i + 1] - mxind[i] > 1:
			ind = mxind[i + 1]
			flag = 1
			break
	if mxind[-1] != n - 1:
		ind = mxind[-1]
	elif mxind[0] != 0:
		ind = mxind[0]
	if c == n:
		print(-1)
	else:
		print(ind + 1)


from collections import defaultdict

def solve(A):
	cnt = defaultdict(list)
	for (i, n) in enumerate(A):
		cnt[n].append(i)
	if len(cnt) == 1:
		return -1
	size = max(cnt.keys())
	if len(cnt[size]) == 1:
		return cnt[size][0] + 1
	for i in cnt[size]:
		if i > 0 and A[i] > A[i - 1]:
			return i + 1
		if i < len(A) - 1 and A[i] > A[i + 1]:
			return i + 1
for _ in range(int(input())):
	input()
	A = [int(x) for x in input().split()]
	print(solve(A))


for t in range(int(input())):
	n = int(input())
	(*a,) = map(int, input().split())
	a = [10 ** 10] + a + [10 ** 10]
	(ans, m) = (-1, 0)
	for i in range(1, n + 1):
		if a[i - 1] < a[i] or a[i] > a[i + 1]:
			if a[i] > m:
				m = a[i]
				ans = i
	print(ans)


t = int(input())
for j in range(t):
	n = int(input())
	s = list(map(int, input().split()))
	ma = max(s)
	f = 0
	for i in range(n):
		if ma != s[i]:
			f = 1
			break
	if f == 0:
		print(-1)
	else:
		for i in range(n):
			if i == 0 and s[1] < s[0] and (s[0] == ma):
				print(1)
				break
			elif i == n - 1 and s[n - 2] < s[n - 1] and (s[n - 1] == ma):
				print(n)
				break
			elif i != 0 and i != n - 1:
				if (s[i] > s[i + 1] or s[i] > s[i - 1]) and s[i] == ma:
					print(i + 1)
					break


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	k = a[0]
	found = False
	b = list(set(a))
	if len(b) == 1:
		print(-1)
	else:
		temp = max(a)
		if a[0] == temp:
			for i in range(0, n - 1):
				if a[i + 1] < temp:
					print(i + 1)
					break
		else:
			print(a.index(temp) + 1)


for tt in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	mx = max(l)
	ans = -1
	for i in range(n):
		if l[i] == mx:
			if i - 1 >= 0 and l[i - 1] < mx:
				ans = i + 1
			elif i + 1 < n and l[i + 1] < mx:
				ans = i + 1
	print(ans)


t = int(input())

def find_sol():
	n = int(input())
	piranhas = [int(i) for i in input().split()]
	m = -1
	for p in piranhas:
		m = max(m, p)
	for (i, p) in enumerate(piranhas):
		if p == m:
			if i > 0 and piranhas[i - 1] < p or (i + 1 < len(piranhas) and piranhas[i + 1] < p):
				return i + 1
	return -1
for _ in range(t):
	sol = find_sol()
	print(sol)


for _ in range(int(input())):
	a = int(input())
	b = [int(i) for i in input().split()]
	f = max(b)
	if min(b) == f:
		print(-1)
	else:
		for i in range(a):
			if b[i] == f:
				if i == 0:
					if b[i] > b[i + 1]:
						print(i + 1)
						break
				if i != 0 and i != a - 1:
					if b[i] > b[i + 1] or b[i] > b[i - 1]:
						print(i + 1)
						break
				if i == a - 1:
					if b[i] > b[i - 1]:
						print(i + 1)
						break


t = int(input())
for tt in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	mx = 0
	for i in range(len(a)):
		if mx < a[i]:
			mx = a[i]
	found = 0
	for i in range(len(a)):
		if mx == a[i]:
			if i - 1 >= 0:
				if a[i - 1] < a[i]:
					found = 1
			if i + 1 < n:
				if a[i + 1] < a[i]:
					found = 1
			if found:
				print(i + 1)
				break
	if not found:
		print(-1)


import os

def main():
	test_cases = int(input())
	ans = [None] * test_cases
	for t in range(test_cases):
		n = int(input())
		s = list(map(int, list(input().split())))
		uniques = set()
		max_v = -1
		for i in range(n):
			uniques.add(s[i])
			if s[i] > max_v:
				max_v = s[i]
		ans[t] = -1
		if len(uniques) > 1:
			for i in range(n):
				if s[i] == max_v:
					if i > 0 and s[i - 1] < max_v or (i < n - 1 and s[i + 1] < max_v):
						ans[t] = i + 1
	os.write(1, '\n'.join(map(str, ans)).encode())
main()


def program():
	notdomi = set()
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	for i in range(n):
		if l[i] == m:
			if i != 0:
				if l[i - 1] != m:
					print(i + 1)
					return
			if i != n - 1:
				if l[i + 1] != m:
					print(i + 1)
					return
	print(-1)
for i in range(int(input())):
	program()


import sys

def f(n):
	m = max(n)
	k = 0
	s = -2
	for i in range(len(n)):
		if n[i] == m:
			if i < len(n) - 1 and n[i + 1] != m:
				s = i
			if i != 0 and n[i - 1] != m:
				s = i
	return s + 1
n = int(input())
for _ in range(n):
	__ = int(input())
	l = list(map(int, input().split()))
	print(f(l))


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	if m == min(l):
		print(-1)
	else:
		for i in range(n):
			if i < n - 1 and (l[i] < m and l[i + 1] == m):
				print(i + 2)
				break
			elif i > 0 and (l[i] < m and l[i - 1] == m):
				print(i)
				break


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		f = False
		for j in range(1, n):
			if a[j] != a[j - 1]:
				f = True
		if f:
			mx = max(a)
			ans = 0
			for j in range(n):
				if j > 0 and a[j] > a[j - 1] and (a[j] == mx):
					ans = j + 1
					break
				if j < n - 1 and a[j] > a[j + 1] and (a[j] == mx):
					ans = j + 1
					break
			print(ans)
		else:
			print(-1)
main()


for i in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	max1 = max(lst)
	f = 1
	for i in range(n):
		if max1 == lst[i]:
			if i == 0:
				if lst[i + 1] < lst[i]:
					print(i + 1)
					f = 0
			elif i == n - 1:
				if lst[i - 1] < lst[i]:
					print(i + 1)
					f = 0
			elif lst[i + 1] < lst[i]:
				print(i + 1)
				f = 0
			elif lst[i - 1] < lst[i]:
				print(i + 1)
				f = 0
		if f == 0:
			break
	if f == 1:
		print(-1)


def f(L):
	b = max(L)
	n = len(L)
	count = 0
	i = 0
	while i < n:
		if i == 0:
			if L[i] == b and L[i + 1] < b:
				return 1
			else:
				i += 1
		elif i == n - 1:
			if L[i] == b and L[i - 1] < b:
				return n
			else:
				return -1
		elif L[i] == b:
			if L[i - 1] < b or L[i + 1] < b:
				return i + 1
			else:
				i += 1
		else:
			i += 1
	return -1
t = int(input())
for i in range(0, t):
	n = int(input())
	L = list(map(int, input().split()))
	print(f(L))


def cal(n, arr):
	if n == 1:
		return -1
	dic = {arr[0]: True}
	maxi = 0
	for i in range(1, n):
		dic[arr[i]] = True
		if i == n - 1 and arr[i] > arr[i - 1] and (arr[i] >= arr[maxi]):
			maxi = i
		elif i != n - 1 and (arr[i] > arr[i - 1] or arr[i] > arr[i + 1]) and (arr[i] >= arr[maxi]):
			maxi = i
	if len(dic) == 1:
		return -1
	return maxi + 1
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(cal(n, arr))


for _ in range(int(input())):
	n = int(input())
	A = [int(x) for x in input().split()]
	s = set(A)
	if len(s) == 1:
		print(-1)
	else:
		maximum = 0
		index = 0
		if A[0] > A[n - 1]:
			index = 1
		else:
			index = n
		for i in range(1, n - 1):
			if A[i] > maximum and (A[i] > A[i - 1] or A[i] > A[i + 1]):
				maximum = A[i]
				index = i + 1
		if A[0] > A[n - 1]:
			if A[0] > maximum:
				index = 1
		elif A[n - 1] > maximum:
			index = n
		print(index)


for _ in range(int(input())):
	N = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) > 1:
		max_ = max(l)
		r = l.index(max_)
		while True:
			if (l[max(0, r - 1)] < max_) | (l[min(N - 1, r + 1)] < max_):
				break
			else:
				r = l.index(max_, r + 1)
		print(r + 1)
	else:
		print(-1)


test_cases = int(input())
while test_cases != 0:
	test_cases = test_cases - 1
	n = int(input())
	inp = list(map(int, input().split()))
	max_val = max(inp)
	indices = [i for (i, _) in enumerate(inp) if _ == max_val]
	no = True
	for i in indices:
		if 0 <= i - 1 < n and inp[i] > inp[i - 1] or (0 <= i + 1 < n and inp[i] > inp[i + 1]):
			print(i + 1)
			no = False
			break
	if no:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	a = sorted(b, reverse=True)
	if sum(a) == len(a) * a[0]:
		print(-1)
	else:
		for i in range(n - 1):
			if a[i] > a[i + 1]:
				if b[-1] == a[i]:
					for j in range(n - 1, -1, -1):
						if a[i] == b[j] and b[j] > b[j - 1]:
							print(j + 1)
							break
				else:
					for j in range(n - 1):
						if a[i] == b[j] and b[j] > b[j + 1]:
							print(j + 1)
							break
				break


t = int(input())
for i in range(t):
	n = int(input())
	lst = list(map(int, input().split()))
	x = -1
	y = max(lst)
	for j in range(len(lst) - 1):
		if lst[j] == y and y > lst[j + 1]:
			x = j + 1
			break
		elif lst[j + 1] == y and y > lst[j]:
			x = j + 2
			break
	print(x)


ans = []
for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		ans += [-1]
	else:
		i = 0
		x = max(a)
		while a[i] < x:
			i += 1
		if i != 0:
			ans += [i + 1]
		else:
			while a[i] == x:
				i += 1
			ans += [i]
print(*ans, sep='\n')


def Solve():
	n = ri()
	a = rl()
	if max(a) == min(a):
		print(-1)
	else:
		mm = max(a)
		a = [2 * mm] + a + [2 * mm]
		for i in range(1, n + 1):
			if a[i] == mm and (a[i - 1] < a[i] or a[i + 1] < a[i]):
				print(i)
				break
import sys
inp = sys.stdin.buffer.readline
rl = lambda : list(map(int, inp().split()))
ri = lambda : int(inp())
rs = lambda : inp().decode().strip()
Testcase = 1
Testcase = ri()
for Test in range(Testcase):
	Solve()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = sorted(a)
	p = b[-1]
	if b[0] == p:
		print(-1)
	else:
		an = 0
		for i in range(n):
			if i == 0:
				if a[i] == p and a[i + 1] < p:
					an = i + 1
					break
			elif i == n - 1:
				if a[i - 1] < p:
					an = i + 1
					break
			elif a[i] == p:
				if a[i - 1] < p or a[i + 1] < p:
					an = i + 1
					break
		print(an)


t = int(input())
for i in range(t):
	n = int(input())
	s = list(map(int, input().split()))
	if min(s) == max(s):
		print(-1)
	else:
		m = s.index(max(s))
		if m == 0:
			while s[m] == s[m + 1]:
				m += 1
		print(m + 1)


def solve(n, l):
	m = l[0]
	a = -1
	for i in range(1, n - 1):
		if l[i] >= m and (l[i] > l[i + 1] or l[i] > l[i - 1]):
			m = l[i]
			a = i + 1
	if l[n - 1] > m and l[n - 1] > l[n - 2]:
		return n
	if m == l[0] and l[1] != m:
		return 1
	return a
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	print(solve(n, l))


import math

def dtb(n):
	return bin(n).replace('0b', '')

def btd(n):
	return int(n, 2)
t = int(input())
for k in range(t):
	n = int(input())
	a = list(map(int, input().split()))[:n]
	b = a[:]
	b.sort(reverse=True)
	if b[0] == b[n - 1]:
		print(-1)
		continue
	for i in range(n):
		if i == 0 and a[i] == b[0]:
			if a[i + 1] != a[i]:
				print(i + 1)
				break
			else:
				continue
		if i == n - 1 and a[i] == b[0]:
			if a[i - 1] != a[i]:
				print(i + 1)
				break
			else:
				continue
		if a[i] == b[0]:
			if a[i - 1] != a[i] or a[i + 1] != a[i]:
				print(i + 1)
				break


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.buffer.readline())

def MI():
	return map(int, sys.stdin.buffer.readline().split())

def LI():
	return list(map(int, sys.stdin.buffer.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def BI():
	return sys.stdin.buffer.readline().rstrip()

def SI():
	return sys.stdin.buffer.readline().rstrip().decode()
for _ in range(II()):
	n = II()
	aa = LI()
	if aa.count(aa[0]) == n:
		print(-1)
		continue
	mx = max(aa)

	def check():
		for (i, a) in enumerate(aa):
			if a == mx:
				if i - 1 >= 0 and aa[i - 1] < a:
					return i + 1
				if i + 1 < n and aa[i + 1] < a:
					return i + 1
	print(check())


test_cases = range(int(input()))
for test_case in test_cases:
	n = int(input())
	pirs = list(map(int, input().split()))
	if len(set(pirs)) == 1:
		print(-1)
		continue
	max_val = max(pirs)
	for (i, pir) in enumerate(pirs):
		if pir == max_val and i > 0 and (i < n - 1):
			if pirs[i - 1] < pir or pirs[i + 1] < pir:
				print(i + 1)
				break
		if pir == max_val and i > 0:
			if pirs[i - 1] < pir:
				print(i + 1)
				break
		if pir == max_val and i < n - 1:
			if pirs[i + 1] < pir:
				print(i + 1)
				break


t = int(input())
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	maxi = max(a)
	ans = None
	if len(set(a)) == 1:
		print(-1)
	else:
		for i in range(n):
			if a[i] == maxi:
				if i > 0 and a[i - 1] < maxi:
					ans = i + 1
					break
				if i < n - 1 and a[i + 1] < maxi:
					ans = i + 1
					break
		print(ans)


import bisect
for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	if 1 == len(set(a)):
		print('-1')
	else:
		x = max(a)
		ans = -1
		for i in range(n):
			if a[i] == x:
				if i > 0 and a[i - 1] != x:
					ans = i + 1
				if i < n - 1 and a[i + 1] != x:
					ans = i + 1
		print(ans)


import math
import sys
from collections import OrderedDict

class Graph:

	def __init__(self, Nodes, is_directed=False):
		self.nodes = Nodes
		self.adj_list = {}
		self.is_directed = is_directed
		for node in self.nodes:
			self.adj_list[node] = []

	def add_edge(self, u, v):
		self.adj_list[u].append(v)
		if self.is_directed == False:
			self.adj_list[v].append(u)

	def print_graph(self):
		for node in self.nodes:
			print(node, '->', self.adj_list[node])

	def degree_node(self, node):
		return len(self.adj_list[node])

	def dfsUTIL(self, v, visited, parents=[]):
		visited[v] = True
		for i in self.adj_list[v]:
			if visited[i] == False:
				self.dfsUTIL(i, visited, parents)
				parents.append(i)

	def dfs(self, v):
		visited = [False] * (max(self.adj_list) + 1)
		parents = [v]
		self.dfsUTIL(v, visited, parents)
		return parents

def dict_sort(ans):
	ans = sorted(ans.items(), reverse=True, key=lambda kv: kv[1])

def is_prime(n):
	if n == 1:
		return 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def seive_primes(n):
	flag = [0] * (n + 10)
	flag[1] = flag[0] = 1
	i = 2
	while i * i <= n + 1:
		if flag[i] == 0:
			j = i * i
			while j <= n + 1:
				flag[j] = 1
				j += i
		i += 1
	return flag

def factors(n):
	d = {}
	while n % 2 == 0:
		if 2 in d:
			d[2] += 1
		else:
			d[2] = 1
		n /= 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
			n /= i
	n = int(n)
	if n > 1:
		d[n] = 1
	return d

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def alphabates():
	return 'abcdefghijklmnopqrstuvwxyz'

def binary_search(ls, n, flag):
	low = 0
	hi = n - 1
	while low <= hi:
		mid = (low + hi) // 2
		if ls[mid] == flag:
			return mid
		elif ls[mid] > flag:
			hi = mid - 1
		else:
			low = mid + 1
	return -1

def qdrt(a, b, c):
	chk = b * b - 4 * a * c
	if chk >= 0:
		ans1 = (-b + chk ** 0.5) / (2 * a)
		ans2 = (-b - chk ** 0.5) / (2 * a)
		return [int(ans1), int(ans2)]
	return -1

def permutation(n, r):
	if n < r:
		return 0
	ans = 1
	for i in range(n - r + 1, n + 1):
		ans *= i
	return ans

def combination(n, r):
	if n < r:
		return 0
	ans = 1
	for i in range(r):
		ans *= n - i
	div = 1
	for i in range(2, r + 1):
		div *= i
	return ans // div

def ispow2(n):
	ans = int(math.log(n, 2))
	if 2 ** ans == n:
		return True
	return False

def _2dmat(n):
	flag = [[i + 1 for i in range(n)]]
	for i in range(2, n + 1):
		new = []
		for j in range((i - 1) * n + 1, i * n + 1):
			new.append(j)
		flag.append(new)
	return flag

def sumn(n):
	return n * (n + 1) // 2

def arrinp():
	ls = list(map(int, input().split()))
	return ls

def mult_inp():
	return map(int, input().split())

def main():
	n = int(input())
	ls = arrinp()
	ans = -1
	if len(set(ls)) == 1:
		ans = -1
	else:
		mx = max(ls)
		for i in range(n):
			if ls[i] == mx:
				if i > 0 and ls[i - 1] != mx:
					ans = i + 1
					break
				elif i < n - 1 and ls[i + 1] != mx:
					ans = i + 1
					break
	print(ans)
for _ in range(int(input())):
	main()


t = int(input())
while t > 0:
	t -= 1
	ans = 0
	n = int(input())
	l = list(map(int, input().split(' ')))
	maxs = max(l)
	if l[0] == maxs and l[1] < maxs:
		print(1)
		continue
	elif l[n - 1] == maxs and l[n - 2] < maxs:
		print(n)
		continue
	else:
		for i in range(1, n - 1):
			if l[i] == maxs and (l[i - 1] < maxs or l[i + 1] < maxs):
				print(i + 1)
				ans = 1
				break
		if ans == 0:
			print(-1)


def R():
	return map(int, input().split())

def L():
	return list(map(int, input().split()))

def I():
	return int(input())
for _ in range(I()):
	n = I()
	a = L()
	m = max(a)
	if m == min(a):
		print('-1')
	else:
		for i in range(n):
			if a[i] != m:
				continue
			if i > 0 and a[i] > a[i - 1] or (i < n - 1 and a[i] > a[i + 1]):
				print(i + 1)
				break


try:
	t = int(input())
	for _ in range(t):
		n = int(input())
		l = list(map(int, input().rstrip().split(' ')))[0:n]
		if len(set(l)) == 1:
			print(-1)
		else:
			MAX = max(l)
			for i in range(n):
				if l[i] == MAX and (i < n - 1 and l[i] > l[i + 1] or (i > 0 and l[i] > l[i - 1])):
					ind = i + 1
					break
			print(ind)
except:
	pass


t = int(input())
while t > 0:
	n = int(input())
	a = list(map(int, input().split(' ')))
	amax = 0
	ok = True
	for i in range(n):
		amax = max(amax, a[i])
	for i in range(n):
		amin = 1000000000
		if i > 0:
			amin = a[i - 1]
		if i < n - 1:
			amin = min(amin, a[i + 1])
		if a[i] > amin and a[i] == amax:
			print(i + 1)
			ok = False
			break
	if ok == True:
		print(-1)
	t -= 1


import math
T = int(input())
for t in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	d = False
	if a.count(a[0]) == n:
		print(-1)
		continue
	ma = max(a)
	for i in range(n):
		if a[i] == ma and (i > 0 and a[i - 1] != ma or (i < n - 1 and a[i + 1] != ma)):
			print(i + 1)
			d = True
			break


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	maxind = 0
	true_ans = False
	cur_true_ans = False
	for i in range(n):
		cur_true_ans = a[i] > a[max(0, i - 1)] or a[i] > a[min(n - 1, i + 1)]
		if a[maxind] == a[i] and cur_true_ans and (not true_ans):
			maxind = i
		if a[maxind] < a[i]:
			maxind = i
		true_ans = a[maxind] > a[max(0, maxind - 1)] or a[maxind] > a[min(n - 1, maxind + 1)]
	if a[maxind] > a[max(0, maxind - 1)] or a[maxind] > a[min(n - 1, maxind + 1)]:
		print(maxind + 1)
	else:
		print(-1)


for k in range(int(input())):
	a = int(input())
	b = list(map(int, input().split()))
	if len(set(b)) == 1:
		print(-1)
	else:
		m = max(b)
		for k in range(a - 1):
			if b[k] == m and b[k] > b[k + 1]:
				print(k + 1)
				break
			elif b[k + 1] == m and b[k] < b[k + 1]:
				print(k + 2)
				break


import math
for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	p = list(set(ar))
	if len(p) == 1:
		print(-1)
	else:
		p = max(ar)
		for i in range(n):
			if ar[i] == p:
				if i == 0:
					if ar[i + 1] < ar[i]:
						print(i + 1)
						break
				elif i == n - 1:
					if ar[i - 1] < ar[i]:
						print(i + 1)
						break
				elif ar[i - 1] < ar[i] or ar[i + 1] < ar[i]:
					print(i + 1)
					break


from math import *
from collections import *
from bisect import *
t = int(input())

def solve():
	n = int(input())
	arr = [int(x) for x in input().split()]
	m = max(arr)
	flag = False
	for i in range(n):
		if arr[i] == m and (i + 1 < n and arr[i] > arr[i + 1] or (i - 1 >= 0 and arr[i] > arr[i - 1])):
			flag = True
			print(i + 1)
			break
	if not flag:
		print(-1)
p = 1
while t:
	t -= 1
	ans = solve()
	p += 1


t = int(input())
for i in range(t):
	count = 0
	n = int(input())
	arr = list(map(int, input().split(' ')))
	if len(set(arr)) == 1:
		print(-1)
	else:
		maxm = arr[0]
		imax = 0
		for i in range(1, n - 1):
			if arr[i] > arr[i + 1] or arr[i] > arr[i - 1]:
				if arr[i] >= maxm:
					maxm = arr[i]
					imax = i
		if arr[0] >= maxm and arr[0] > arr[1]:
			imax = 0
			maxm = arr[0]
		if arr[n - 1] >= maxm and arr[n - 1] > arr[n - 2]:
			imax = n - 1
			maxm = arr[n - 1]
		print(imax + 1)


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if l.count(l[0]) == n:
		print(-1)
	else:
		a = max(l)
		ans = 1
		for j in range(n):
			if l[j] == a and (l[max(0, j - 1)] < a or l[min(n - 1, j + 1)] < a):
				ans = j + 1
				break
		print(ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	k = max(a)
	c = 0
	for i in range(n - 1):
		if a[i] < k and a[i + 1] == k:
			print(i + 2)
			c = 1
			break
		if a[i] == k and a[i + 1] < k:
			print(i + 1)
			c = 1
			break
	if c == 0:
		print(-1)


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	mini = 99999999999
	maxi = -1
	store = 0
	a = [a[0]] + a + [a[-1]]
	for i in range(1, n + 1):
		if a[i - 1] < a[i] or a[i] > a[i + 1]:
			if a[i] > maxi:
				maxi = a[i]
				store = i
	for i in range(n):
		mini = min(mini, a[i])
	if maxi == -1:
		print(-1)
	else:
		print(store)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	count = set()
	for i in range(n):
		count.add(arr[i])
	if len(count) == 1:
		print(-1)
		continue
	index = 0
	maxx = arr[0]
	for i in range(1, n - 1):
		if arr[i] >= maxx and (arr[i] > arr[i - 1] or arr[i] > arr[i + 1]):
			maxx = arr[i]
			index = i
	if arr[-1] >= maxx and arr[-1] > arr[-2]:
		index = n - 1
	print(index + 1)


test_count = int(input())
tests = []
for _ in range(test_count):
	x = int(input())
	y = list(map(int, input().split()))
	tests.append((x, y))
for test in tests:
	(x, prns) = test
	max_prn = max(prns)
	max_idx_list = []
	for (idx, prn) in enumerate(prns):
		if prn == max_prn:
			max_idx_list.append(idx)
	max_idx_list = set(max_idx_list)
	res = -1
	for idx in max_idx_list:
		if idx == 0:
			if 1 in max_idx_list:
				continue
			else:
				res = idx
				break
		elif idx == len(prns) - 1:
			if len(prns) - 2 in max_idx_list:
				continue
			else:
				res = idx
				break
		elif idx - 1 in max_idx_list and idx + 1 in max_idx_list:
			continue
		else:
			res = idx
			break
	print(res + 1 if res != -1 else -1)


from sys import stdin, stdout
input = stdin.readline
from collections import defaultdict as dd
import math

def geti():
	return map(int, input().strip().split())

def getl():
	return list(map(int, input().strip().split()))

def gets():
	return input()

def geta():
	return int(input())

def print_s(s):
	stdout.write(s + '\n')

def solve():
	for _ in range(geta()):
		n = geta()
		a = getl()
		ans = -1
		maxi = max(a)
		if len(set(a)) == 1:
			print(-1)
			continue
		for i in range(n):
			if a[i] == maxi:
				if i > 0 and a[i] > a[i - 1] or (i < n - 1 and a[i] > a[i + 1]):
					ans = i + 1
					break
		print(ans)
solve()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if [arr[0]] * n == arr:
		print(-1)
	else:
		max_val = max(arr)
		for i in range(n):
			if i == 0:
				if arr[0] == max_val and arr[1] < max_val:
					print(1)
					break
			elif i == n - 1:
				if arr[n - 1] == max_val and arr[n - 2] < max_val:
					print(n)
					break
			elif arr[i] == max_val and (arr[i - 1] < max_val or arr[i + 1] < max_val):
				print(i + 1)
				break


from functools import reduce
import os
import sys
from collections import *
from math import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]
mo = 1000000007
inf = 1e+18
div = 998244353
for _ in range(inn()):
	n = inn()
	a = arr()
	mx = max(a)
	ans = -1
	for i in range(n):
		if a[i] == mx:
			if i - 1 >= 0 and a[i - 1] < a[i] or (i + 1 < n and a[i + 1] < a[i]):
				ans = i + 1
				break
	print(ans)


import sys
sysinput = sys.stdin.readline
import time
start_time = time.time()

def inp():
	return int(sysinput())

def inlt():
	return list(map(int, sysinput().split()))

def insr():
	s = sysinput()
	return list(s[:len(s) - 1])

def invr():
	return map(int, sysinput().split())

def answer(n, a):
	if len(set(a)) == 1:
		return -1
	lfish = max(a)
	for i in range(1, n):
		if a[i - 1] != a[i]:
			if a[i] == lfish:
				return i + 1
			elif a[i - 1] == lfish:
				return i
t = inp()
while t > 0:
	t -= 1
	n = inp()
	a = inlt()
	print(answer(n, a))


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	(mx, mn) = (max(a), min(a))
	if mx == mn:
		print(-1)
		continue
	ind = a.index(mx)
	if n == 2:
		print(ind + 1)
		continue
	for i in range(ind, n):
		if i > 0:
			if a[i - 1] < mx:
				fl = i
				break
		if i < n - 1:
			if a[i + 1] < mx:
				fl = i
				break
	print(fl + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	ind = [i for (i, x) in enumerate(a) if x == m]
	k = len(ind)
	f = 1
	for i in range(k):
		if ind[i] == 0 and a[1] == m:
			f = 1
		elif ind[i] == n - 1 and a[-2] == m:
			f = 1
		elif a[ind[i] - 1] < m or a[ind[i] + 1] < m:
			f = 0
			ans = ind[i]
			break
		else:
			f = 1
	if f == 1:
		print(-1)
	else:
		print(ans + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	maximum = 0
	max_index = 0
	for i in range(n):
		if a[i] > maximum:
			max_index = i
			maximum = a[i]
	if max_index == 0:
		j = 1
		while a[j] == maximum:
			if j == n - 1:
				max_index = -1
				break
			max_index = j
			j += 1
	if max_index != -1:
		max_index += 1
	print(max_index)


for u in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	x = -1
	m = max(l)
	if len(set(l)) == 1:
		print(-1)
	elif l[0] == m and l[0] > l[1]:
		x = 1
		print(1)
	elif l[n - 1] == m and l[n - 1] > l[n - 2]:
		print(n)
	else:
		for i in range(1, n - 1):
			if l[i] > l[i - 1] and l[i] == m:
				x = i + 1
				break
			elif l[i] > l[i + 1] and l[i] == m:
				x = i + 1
				break
		print(x)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	arr = list(map(int, input().split(' ')))
	max_ele = max(arr)
	if arr.count(max_ele) == len(arr):
		print('-1')
	else:
		for i in range(len(arr)):
			if arr[i] == max_ele:
				if i == 0 and arr[i + 1] < arr[i]:
					print(i + 1)
					break
				elif i == len(arr) - 1 and arr[i - 1] < arr[i]:
					print(i + 1)
					break
				elif i != 0 and i != len(arr) - 1 and (arr[i] > arr[i - 1] or arr[i] > arr[i + 1]):
					print(i + 1)
					break


def solve2(a):
	if len(set(a)) == 1:
		return -1
	if len(a) == 1:
		return 1
	ma = max(a)
	for (idx, p) in enumerate(a):
		if p != ma:
			continue
		if idx < len(a) - 1 and p > a[idx + 1]:
			return idx + 1
		if idx > 0 and p > a[idx - 1]:
			return idx + 1

def run():
	(t, *_) = list(map(int, input().split()))
	for _ in range(t):
		(n, *_) = list(map(int, input().split()))
		a = list(map(int, input().split()))
		print(solve2(a))
run()


from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
from collections import Counter
from math import sqrt
import collections
import math
import heapq
import re

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	for _ in range(int(input())):
		n = inin()
		a = ain()
		flag = 0
		largest = max(a)
		for i in range(n):
			if a[i] == largest:
				if i > 0 and i < n - 1:
					if a[i - 1] < largest or a[i + 1] < largest:
						print(i + 1)
						flag = 1
						break
				elif i == 0:
					if a[i + 1] < largest:
						print(i + 1)
						flag = 1
						break
				elif a[i - 1] < largest:
					print(i + 1)
					flag = 1
					break
		if flag == 0:
			print(-1)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
from collections import deque
from sys import stdin, stdout, setrecursionlimit
from string import ascii_letters
letters = ascii_letters[:26]
from collections import defaultdict
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	mn = min(arr)
	mx = max(arr)
	if mn == mx:
		print(-1)
		continue
	was = False
	for i in range(n):
		if arr[i] == mx and (i > 0 and arr[i - 1] < mx or (i < n - 1 and arr[i + 1] < mx)):
			print(i + 1)
			was = True
			break
	if not was:
		print(-1)


for __ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(a)
	m = max(a)
	i = a.index(m)
	if a.count(m) == len(a):
		print(-1)
	else:
		if i == 0:
			while a[i] == a[i + 1]:
				i += 1
		print(i + 1)


for _ in range(int(input())):
	n = int(input())
	x = list(map(int, input().split()))
	mx = -1
	mxi = -1
	if len(set(x)) == 1:
		print(-1)
		continue
	for i in range(len(x)):
		if mx < x[i]:
			if 0 < i < len(x) - 1:
				if x[i - 1] != x[i] or x[i] != x[i + 1]:
					mx = x[i]
					mxi = i
			if i == 0:
				if x[i] != x[i + 1]:
					mx = x[i]
					mxi = i
			if i == len(x) - 1:
				if x[i] != x[i - 1]:
					mx = x[i]
					mxi = i
	print(mxi + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	f = len(set(a)) == 1
	if f:
		print(-1)
		continue
	lst = a[0]
	res = -1
	for i in range(n):
		if a[i] >= lst:
			if i != 0 and a[i] > a[i - 1] or (i != n - 1 and a[i] > a[i + 1]):
				lst = a[i]
				res = i
	print(res + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(list(set(a))) == 1:
		print(-1)
		continue
	v = a[0]
	p = 0
	m = max(a)
	for i in range(0, n):
		if i + 1 < n and a[i] == m and (a[i + 1] != m):
			print(i + 1)
			break
		if a[n - 1] == m and a[n - 2] != m:
			print(n)
			break
		if i > 0 and a[i] == m and (a[i - 1] != m):
			print(i + 1)
			break


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from itertools import accumulate

def Int():
	return int(sys.stdin.readline())

def Mint():
	return map(int, sys.stdin.readline().split())

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

def List():
	return list(map(int, sys.stdin.readline().split()))

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

def dtob(n):
	return bin(n).replace('0b', '')

def btod(n):
	return int(n, 2)

def common(l1, l2):
	return set(l1).intersection(l2)

def solution():
	for _ in range(Int()):
		n = Int()
		a = List()
		m = max(a)
		ma = sys.maxsize
		a = [ma] + a + [ma]
		ans = -1
		for i in range(1, n + 1):
			if a[i] > a[i - 1] or a[i] > a[i + 1]:
				if a[i] == m:
					ans = i
					break
		print(ans)
solution()


for s in [*open(0)][2::2]:
	l = list(map(int, s.split()))
	a = 0
	c = sum((l[a] != i for i in l))
	for i in range(1, len(l) - 1):
		if l[a] <= l[i]:
			if l[i - 1] != l[i] or l[i + 1] != l[i]:
				a = i
	if l[-1] > l[a]:
		a = len(l) - 1
	print((-1, a + 1)[c > 0])


for j in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	p = max(l)
	y = set(l)
	if len(y) == 1:
		print(-1)
	else:
		for i in range(n):
			if l[i] == p:
				if i > 0 and i < n - 1:
					if l[i - 1] < l[i] or l[i + 1] < l[i]:
						print(i + 1)
						break
				elif i == 0:
					if l[i + 1] < l[i]:
						print(i + 1)
						break
				elif i == n - 1:
					if l[i - 1] < l[i]:
						print(i + 1)
						break


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	mxp = [0] * n
	mxs = [0] * n
	ans = -1
	mx = 0
	for i in range(n):
		mxp[i] = mx
		mx = max(mx - 1, a[i])
	mx = 0
	for i in range(n - 1, -1, -1):
		mxs[i] = mx
		mx = max(mx - 1, a[i])
	for i in range(n):
		if a[i] > mxp[i] and a[i] + i > mxs[i] or (a[i] > mxs[i] and a[i] + (n - i - 1) > mxp[i]):
			ans = i + 1
			break
	print(ans)


for i in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	mx = max(li)
	idx = -1
	if li[0] == mx and li[1] < li[0]:
		print(1)
	elif li[-1] == mx and li[-2] < li[-1]:
		print(n)
	else:
		for i in range(1, n - 1):
			if li[i] == mx and (li[i - 1] < mx or li[i + 1] < mx):
				idx = i
				break
		if idx != -1:
			print(idx + 1)
		else:
			print(idx)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions, statistics
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		n = ri()
		a = ria()
		c = max(a)
		a = [c] + a + [c]
		z = []
		k = 0
		for j in range(len(a)):
			if a[j] == c:
				z.append(j)
				k += 1
		m = 0
		ans = -1
		if k != n + 2:
			for i in range(1, len(z) - 1):
				dist = z[i] - z[i - 1] + z[i + 1] - z[i]
				if dist > m:
					m = dist
					ans = z[i]
		print(ans)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


from typing import *

def get_peaks(l: List[int]) -> List[int]:
	result = []
	current_max = l[0]
	for i in range(len(l)):
		current_element = l[i]
		if current_max < current_element:
			result.clear()
			current_max = current_element
			result.append(i)
		elif current_element == current_max:
			result.append(i)
	return result

def get_dominant(piranhas: List[int]) -> int:
	dominants = get_peaks(piranhas)
	if len(dominants) == 1:
		return dominants[0]
	elif len(dominants) == len(piranhas):
		return -2
	else:
		if dominants[0] != 0:
			return dominants[0]
		if dominants[-1] != len(piranhas) - 1:
			return dominants[-1]
		for i in range(1, len(dominants)):
			if dominants[i] - dominants[i - 1] != 1:
				return dominants[i - 1]
	return -2

def main():
	result = []
	for _ in range(int(input())):
		input()
		piranhas = [int(i) for i in input().split()]
		result.append(get_dominant(piranhas) + 1)
	for r in result:
		print(r)
main()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	x = max(l)
	ans = -1
	for i in range(n):
		if i != 0 and l[i] == x and (l[i - 1] < l[i]):
			ans = i + 1
			break
		if i < n - 1 and l[i] == x and (l[i + 1] < l[i]):
			ans = i + 1
			break
	print(ans)


T = int(input())
for _ in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	best = max(a)
	answer = -1
	for i in range(n):
		if a[i] != best:
			continue
		if i - 1 >= 0 and a[i - 1] < a[i] or (i + 1 < n and a[i] > a[i + 1]):
			answer = i + 1
			break
	print(answer)


from sys import stdin, stdout
n = int(stdin.readline())
for i in range(n):
	k = stdin.readline()
	lst = [int(i) for i in stdin.readline().split()]
	c = max(lst)
	temp = lst[0]
	ans = -1
	indx = 1
	for i in lst[1:]:
		if i == temp and i == c:
			indx += 1
			continue
		if i == c and i != temp:
			ans = indx
			break
		if temp == c and i != temp:
			ans = indx - 1
			break
		indx += 1
	if ans == -1:
		ans = -2
	stdout.write(str(ans + 1) + '\n')


from collections import deque
t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	t = max(l)
	flag = True
	for i in range(n):
		if l[i] == t:
			if i == 0:
				if l[i] > l[i + 1]:
					print(1)
					flag = False
					break
			elif i == n - 1:
				if l[i] > l[i - 1]:
					print(n)
					flag = False
					break
			elif l[i] > l[i + 1] or l[i] > l[i - 1]:
				print(i + 1)
				flag = False
				break
	if flag:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	aux = [0 for i in range(n)]
	for i in range(n):
		if i > 0 and arr[i] > arr[i - 1]:
			aux[i] = 1
		if i < n - 1 and arr[i] > arr[i + 1]:
			aux[i] = 1
	m = max(arr)
	ans = -1
	for i in range(n):
		if arr[i] == m and aux[i] == 1:
			ans = i + 1
			break
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	maxi = max(arr)
	mini = min(arr)
	if maxi == mini:
		print(-1)
	else:
		for j in range(len(arr)):
			if arr[j] == maxi and (j > 0 and arr[j - 1] < arr[j] or (j < len(arr) - 1 and arr[j + 1] < arr[j])):
				print(j + 1)
				break


from collections import Counter as cn
import sys

def mod():
	return 10 ** 9 + 7
t = int(input())
while t:
	t -= 1
	n = int(input())
	arr = list(map(int, input().split()))
	x = max(arr)
	y = arr.count(x)
	if y == n:
		print(-1)
		continue
	if y == 1:
		print(arr.index(x) + 1)
		continue
	arr.append(0)
	arr.insert(0, 0)
	for i in range(1, n + 1):
		if i == 1 and arr[1] == x and (arr[2] != x):
			print(1)
			break
		elif i == n and arr[i] == x and (arr[i - 1] != x):
			print(i)
			break
		elif i != 1 and i != n and (arr[i] == x) and (arr[i - 1] != x or arr[i + 1] != x):
			print(i)
			break


import sys
test_case_num = int(input())
for i in range(test_case_num):
	num = int(input())
	p = list(map(int, input().split()))
	max_size = max(p)
	answer = -1
	if len(set(p)) != 1:
		for j in range(num):
			if p[j] == max_size:
				if j == 0 and p[j + 1] < p[j]:
					answer = j + 1
					break
				elif j == num - 1 and p[j - 1] < p[j]:
					answer = j + 1
					break
				elif j != 0 and j != num - 1 and (p[j - 1] < p[j] or p[j + 1] < p[j]):
					answer = j + 1
					break
	print(answer)


def chkList(lst):
	return len(set(lst)) == 1
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	flag = True
	flag1 = False
	if chkList(a):
		print(-1)
		flag = False
	if flag:
		for i in range(len(a)):
			if a[i] == m:
				if i - 1 >= 0 and a[i - 1] < a[i] or (i + 1 < len(a) and a[i + 1] < a[i]):
					print(i + 1)
					flag1 = True
					break
		if flag1 == False:
			print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	fish = list(map(int, input().split()))
	found = False
	ans = -1
	idx = 0
	maxFish = 0
	strongestFishIdx = 0
	while idx < n:
		if fish[idx] >= maxFish:
			maxFish = fish[idx]
			if idx == 0 and fish[idx + 1] != fish[idx] or (idx == n - 1 and fish[idx] != fish[idx - 1]) or (0 < idx < n - 1 and (fish[idx] != fish[idx - 1] or fish[idx] != fish[idx + 1])):
				strongestFishIdx = idx
				found = True
		idx += 1
	if found > 0:
		ans = strongestFishIdx + 1
	print(ans)


for _ in range(int(input())):
	index = 1
	inde = 1
	n = int(input())
	l = list(map(int, input().split()))
	ma = max(l)
	p = l.count(ma)
	i = 0
	u = len(l)
	for i in range(n - 1):
		if l[i] == ma and l[i + 1] != ma:
			index = i
		elif l[i] == ma and l[i - 1] != ma:
			index = i
	for i in range(n):
		if l[i] == ma:
			inde = i
	a = len(set(l))
	if a >= 2:
		if index >= 0 and p > 1:
			print(index + 1)
		elif p == 1:
			print(inde + 1)
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	maxA = max(A)
	ans = -2
	for (i, a) in enumerate(A):
		if a == maxA:
			if i and A[i - 1] < a or (i < n - 1 and A[i + 1] < a):
				ans = i
				break
	print(ans + 1)


testcases = int(input())
for testcase in range(testcases):
	n = int(input())
	temparr = input()
	temparr = temparr.split()
	arr = []
	dicts = {}
	for i in temparr:
		i = int(i)
		arr.append(i)
		if i not in dicts:
			dicts[i] = 1
	if len(dicts) == 1:
		print(-1)
		continue
	getmax = max(arr)
	ans = 0
	for i in range(n):
		if i == 0 and arr[i] == getmax and (arr[i + 1] < getmax):
			ans = i + 1
			break
		elif i == n - 1 and arr[i] == getmax and (arr[i - 1] < getmax):
			ans = i + 1
			break
		elif arr[i] == getmax and (arr[i - 1] < getmax or arr[i + 1] < getmax) and (i != 0) and (i != n - 1):
			ans = i + 1
			break
	print(ans)


for k in range(int(input())):
	n = int(input())
	vec = list(map(int, input().split()))
	m = max(vec)
	ind = -1
	for i in range(0, n):
		if vec[i] == m:
			if i != 0 and vec[i - 1] != m:
				ind = i + 1
				break
			elif i != n - 1 and vec[i + 1] != m:
				ind = i + 1
				break
	print(ind)


t = int(input())
for i in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	l = len(li)
	m = max(li)
	if li[0] == m and li[0] != li[1]:
		print(1)
	elif li[l - 1] == m and li[l - 2] != m:
		print(l)
	else:
		for j in range(1, l - 1):
			if li[j] == m and (li[j - 1] < li[j] or li[j + 1] < li[j]):
				print(j + 1)
				break
		else:
			print(-1)


t = int(input())
for j in range(t):
	a = 0
	n = int(input())
	A = list(map(int, input().split()))
	m = max(A)
	if len(set(A)) == 1:
		print(-1)
	else:
		for i in range(len(A)):
			if A[i] == m:
				if i > 0 and A[i - 1] < m:
					print(i + 1)
					break
				elif i < len(A) - 1 and A[i + 1] < m:
					print(i + 1)
					break


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	j = l.index(max(l))
	c = 0
	for i in range(1, n - 1):
		if l[i] == l[j] and (l[i - 1] < l[i] or l[i + 1] < l[i]):
			print(i + 1)
			c = 1
			break
	if c == 0:
		if l[j] == l[0] and l[0] > l[1]:
			print(1)
		elif l[j] == l[-1] and l[-1] > l[-2]:
			print(n)
		else:
			print(-1)


t = int(input())
while t != 0:
	n = int(input())
	list1 = list(map(int, input().split()))
	maxi = max(list1)
	possible = []
	for i in range(len(list1)):
		if list1[i] == maxi:
			possible.append(i)
	f = 1
	fa = -1
	for uu in range(len(possible)):
		j = possible[uu] - 1
		k = possible[uu] + 1
		val = maxi
		f = 1
		fa = possible[uu]
		while True:
			inside = 0
			if j < 0 and k >= len(list1):
				break
			else:
				if j >= 0:
					if list1[j] < maxi:
						maxi += 1
						j -= 1
						inside = 1
				if k < len(list1):
					if list1[k] < maxi:
						k += 1
						maxi += 1
						inside = 1
			if inside == 0:
				f = 0
				break
		if f == 1:
			break
	if f == 0:
		print(-1)
	else:
		print(fa + 1)
	t -= 1


from sys import stdin, stdout
from collections import *
st = lambda : list(stdin.readline().strip())
li = lambda : list(map(int, stdin.readline().split()))
mp = lambda : map(int, stdin.readline().split())
inp = lambda : int(stdin.readline())
pr = lambda n: stdout.write(str(n) + '\n')
mod = 1000000007
INF = float('inf')

def solve():
	n = inp()
	l = li()
	x = max(l)
	y = min(l)
	if x == y:
		pr(-1)
		return
	for i in range(1, n):
		if l[i] == x and l[i - 1] < x:
			pr(i + 1)
			return
	for i in range(n - 1):
		if l[i] == x and l[i + 1] < x:
			pr(i + 1)
			return
	pr(-1)
for _ in range(inp()):
	solve()


import sys
import itertools

def get_line():
	return list(map(int, sys.stdin.readline().strip().split()))

def in1():
	return int(input())
for _ in range(in1()):
	n = in1()
	a = get_line()
	t1 = max(a)
	t2 = min(a)
	if t1 == t2:
		print(-1)
	else:
		for i in range(n):
			if a[i] == t1 and i > 0 and (a[i] > a[i - 1]):
				t3 = i
				break
			if a[i] == t1 and i < n - 1 and (a[i] > a[i + 1]):
				t3 = i
				break
		print(t3 + 1)


from sys import stdin, stdout
from collections import defaultdict
input = stdin.readline
print = stdout.write
for _ in range(int(input())):
	n = int(input())
	fish = list(map(int, input().split()))
	M = max(fish)
	allsame = True
	for i in range(n):
		if fish[i] != M:
			allsame = False
			break
	if allsame:
		print('-1\n')
	else:
		index = 0
		for i in range(n):
			if i == 0 and fish[0] == M:
				if fish[0] > fish[1]:
					index = i + 1
					break
			elif i == n - 1 and fish[i] == M:
				if fish[i - 1] < fish[i]:
					index = i + 1
					break
			elif fish[i - 1] < fish[i] or fish[i] > fish[i + 1]:
				if fish[i] == M:
					index = i + 1
					break
		print(str(index) + '\n')


for _ in range(int(input())):
	n = int(input())
	count = 0
	a = [int(x) for x in input().split()]
	for i in range(n - 1):
		if a[i] == a[i + 1]:
			count += 1
	if count + 1 == n:
		print(-1)
	else:
		m = max(a)
		if a[n - 1] == m and a[n - 2] < m:
			print(n)
			continue
		if a[0] == m and a[1] < m:
			print(1)
			continue
		for i in range(1, n - 1):
			if a[i] == m and a[i - 1] != m or (a[i] == m and a[i + 1] != m):
				print(i + 1)
				break


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	maxx = max(arr)
	if len(set(arr)) == 1:
		print(-1)
	else:
		ans = []
		for i in range(len(arr)):
			if arr[i] == maxx:
				arr[i] = 1
			else:
				arr[i] = 0
		for i in range(len(arr) - 1):
			if arr[i] == 0 and arr[i + 1] == 1:
				ans.append(i + 2)
			elif arr[i] == 1 and arr[i + 1] == 0:
				ans.append(i + 1)
		print(ans[0])


n = int(input())
sol = []
lists = []
for lis in range(n):
	length = int(input())
	aq = input().split()
	for i in range(length):
		aq[i] = int(aq[i])
	lists.append(aq)
for aq in lists:
	t_max = max(aq)
	t_min = min(aq)
	if t_min < t_max:
		for i in range(len(aq)):
			if i == 0 and aq[i] == t_max and (aq[i] > aq[i + 1]):
				sol.append(i + 1)
				break
			elif i == len(aq) - 1 and aq[i] == t_max and (aq[i] > aq[i - 1]):
				sol.append(i + 1)
				break
			elif not (i == 0 or i == len(aq) - 1) and aq[i] == t_max and (aq[i] > aq[i + 1] or aq[i] > aq[i - 1]):
				sol.append(i + 1)
				break
	else:
		sol.append(-1)
for ans in sol:
	print(ans)


t = int(input())
w = []
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	ma = max(a)
	mi = min(a)
	if ma == mi:
		w.append(-1)
	else:
		s = a.index(ma)
		if s == 0:
			while s < n - 1:
				if a[s] == a[s + 1]:
					s = s + 1
				else:
					break
		w.append(s + 1)
for i in w:
	print(i)


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(-1)
		continue
	mx = max(a)
	for i in range(n):
		if 0 < i < n - 1:
			if a[i] == mx and (a[i - 1] < mx or a[i + 1] < mx):
				print(i + 1)
				break
		elif i > 0:
			if a[i] == mx and a[i - 1] < mx:
				print(i + 1)
				break
		elif a[i] == mx and a[i + 1] < mx:
			print(i + 1)
			break


for iii in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	mx = -100
	cnt = 0
	maxes = []
	for i in range(n):
		if lst[i] > mx:
			mx = lst[i]
			cnt = 1
			maxes = [i]
		elif lst[i] == mx:
			cnt += 1
			maxes.append(i)
	if len(maxes) == 1:
		print(maxes[0] + 1)
		continue
	elif len(maxes) == n:
		print(-1)
	else:
		for i in maxes:
			if i - 1 >= 0 and lst[i - 1] < lst[i] or (i + 1 < n and lst[i + 1] < lst[i]):
				print(i + 1)
				break
		else:
			print(-1)


T = int(input())
for t in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	nax = max(a)
	ans = -1
	if a[0] == nax:
		if a[1] != nax:
			print(1)
			continue
	if a[n - 1] == nax:
		if a[n - 2] != nax:
			print(n)
			continue
	for i in range(1, n - 1):
		if a[i] == nax:
			if a[i - 1] != nax or a[i + 1] != nax:
				found = True
				ans = i + 1
				break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	(ans, tp) = (-2, max(l))
	for i in range(n):
		if i == 0:
			if l[i] == tp:
				if l[i + 1] < tp:
					ans = i
					break
		elif i == n - 1:
			if l[i] == tp:
				if l[i - 1] < tp:
					ans = i
					break
		elif l[i] == tp:
			if l[i + 1] < l[i] or l[i - 1] < l[i]:
				ans = i
				break
	print(ans + 1)


for i in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	if len(set(a)) == 1:
		print(-1)
	elif a.count(max(a)) == 1:
		print(a.index(max(a)) + 1)
	else:
		for j in range(a.index(max(a)), n - 1):
			if j == 0:
				if a[j] > a[j + 1] and a[j] == max(a):
					print(j + 1)
					break
			elif (a[j] > a[j + 1] or a[j] > a[j - 1]) and a[j] == max(a):
				print(j + 1)
				break


try:
	t = int(input())
	while t:
		t = -1
		n = int(input())
		a = list(map(int, input().split()))
		if len(set(a)) == 1:
			print(-1)
		else:
			mx = max(a)
			for i in range(n):
				if a[i] == mx:
					if i > 0:
						if a[i - 1] < mx:
							ans = i + 1
							break
					if i < n - 1:
						if a[i + 1] < mx:
							ans = i + 1
							break
			print(ans)
except:
	pass


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	ans = False
	new = [i for i in range(n) if a[i] == m]
	for i in a:
		if i != m:
			p = a.index(i)
			ans = True
			break
	if ans:
		print(min(new, key=lambda x: abs(x - p)) + 1)
	else:
		print(-1)


t = int(input())
for i in range(t):
	n = int(input())
	s = 0
	x = input()
	l = [int(i) for i in x.split()]
	if l.count(l[0]) == len(l):
		print(-1)
	else:
		maxx = max(l)
		for i in range(len(l)):
			if l[i] == maxx:
				if i == 0:
					if l[0] > l[1]:
						print(1)
						break
				elif i == n - 1:
					if l[n - 1] > l[n - 2]:
						print(n)
						break
				elif l[i] > l[i + 1] or l[i] > l[i - 1]:
					print(i + 1)
					break


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		M = max(a)
		occs = a.count(M)
		if occs == n:
			print(-1)
		else:
			if a[0] == M and a[1] != M:
				print(1)
				continue
			if a[-1] == M and a[-2] != M:
				print(n)
				continue
			for j in range(1, n - 1):
				if a[j] == M and (a[j - 1] != M or a[j + 1] != M):
					print(j + 1)
					break
main()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		if n == 1:
			print(1)
		else:
			print(-1)
	else:
		m = 0
		ind = 0
		for i in range(n):
			if l[i] > m:
				if i < n - 1 and l[i] > l[i + 1] or (i > 0 and l[i] > l[i - 1]):
					m = l[i]
					ind = i + 1
		print(ind)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input().split()
	v = list(map(int, s))
	mx = max(v)
	result = -2
	for i in range(n):
		if v[i] == mx:
			if i > 0 and v[i - 1] < mx:
				result = i
				break
			if i < n - 1 and v[i + 1] < mx:
				result = i
				break
	print(result + 1)


def solve():
	n = int(input())
	lst = list(map(int, input().split()))
	maxx = -1
	indx = -1
	for i in range(n):
		if i == 0:
			if lst[i] > lst[i + 1]:
				maxx = lst[i]
				indx = i
		elif i == n - 1:
			if lst[i] > lst[i - 1] and lst[i] > maxx:
				maxx = lst[i]
				indx = i
		elif lst[i] > maxx:
			if lst[i] > lst[i - 1] or lst[i] > lst[i + 1]:
				maxx = lst[i]
				indx = i
	if indx != -1:
		indx += 1
	print(indx)
	return
t = int(input())
while t != 0:
	solve()
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	num = max(a)
	ans = -1
	for i in range(n):
		if a[i] == num:
			if i > 0 and i < n - 1:
				if a[i] > a[i - 1] or a[i] > a[i + 1]:
					ans = i + 1
					break
			if i == 0 and a[0] != a[1]:
				ans = 1
				break
			if i == n - 1 and a[n - 1] != a[n - 2]:
				ans = n
				break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	cnt = 0
	m = 0
	ss = -1
	for i in range(n):
		if a[i] > m:
			m = a[i]
		if a[i] == m:
			if i > 0 and a[i - 1] < a[i]:
				ss = i
			elif i < n - 1 and a[i] > a[i + 1]:
				ss = i
	if ss + 1:
		print(ss + 1)
	else:
		print(-1)


t = int(input())
for i in range(t):
	n = int(input())
	array = list(map(int, input().split()))
	max_index = 0
	max = array[0]
	for j in range(n):
		if array[j] >= max:
			max = array[j]
			max_index = j
	if max_index != n - 1:
		print(max_index + 1)
	else:
		x = True
		for j in range(max_index, 0, -1):
			if array[j - 1] < array[j]:
				print(j + 1)
				x = False
				break
		if x:
			print(-1)


def max_fish(arr):
	if len(set(arr)) == 1:
		return -1
	best = max(arr)
	for (i, fish) in enumerate(arr):
		if fish != best:
			continue
		if i - 1 >= 0:
			if arr[i - 1] < fish:
				return i + 1
		if i + 1 <= len(arr) - 1:
			if arr[i + 1] < fish:
				return i + 1
for i in range(int(input())):
	n = input()
	print(max_fish(list(map(int, input().split()))))


from sys import stdin
for _ in range(int(stdin.readline())):
	l = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	maxs = max(a)
	idx = -1
	if a[0] == maxs:
		for i in range(l):
			if a[i] != maxs:
				idx = i
				break
	else:
		for i in range(l):
			if a[i] == maxs:
				idx = i + 1
				break
	print(idx)


from itertools import tee, chain

def read_int() -> int:
	return int(input())

def read_ints():
	return map(int, input().split(' '))
INF = 9999999999999

def test_case():
	n = read_int()
	a = tuple(read_ints())
	m = max(a)
	a = tuple(chain((INF,), a, (INF,)))
	(i1, i2, i3) = tee(a, 3)
	next(i2)
	next(i3)
	next(i3)
	for (ind, (x, y, z)) in enumerate(zip(i1, i2, i3), 1):
		if y == m and (INF != x != y or y != z != INF):
			return ind
	return -1
for _ in range(read_int()):
	print(test_case())


for _ in range(int(input())):
	input()
	aqua = list(map(int, input().split()))
	max_aqua = max(aqua)
	if min(aqua) == max_aqua:
		print(-1)
	else:
		min_index = aqua.index(min(aqua))
		max_r = max(aqua[min_index:])
		if max_aqua == max_r:
			print(aqua[min_index:].index(max_aqua) + min_index + 1)
		else:
			print(min_index - aqua[:min_index][::-1].index(max_aqua))