1
3
5 3 4
 6
5
5 3 4 4 5
3
1 1 1
5
4 4 3 4 4
5
5 5 4 3 2
3
1 1 2
5
5 4 3 5 5
 1
3
10 1 5

1
 1
-1
2
2
3
1
 1

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)
				

