A post on facebook is said to be more *popular* if the number of likes on the post is strictly greater than the number of likes on some other post. In case the number of likes is same, the post having more comments is more *popular*.

Given arrays A and B, each having size N, such that the number of likes and comments on the i^{th} post are A_{i} and B_{i} respectively, find out which post is most *popular*.

It is guaranteed that the number of comments on all the posts is distinct.

------ Input Format ------ 

- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of multiple lines of input.
- The first line of each test case contains a single integer N, the number of posts.
- The second line of each test case contains N space-separated integers A_{1}, A_{2}, \ldots, A_{N} — where A_{i} is the number of likes on the i^{th} post.
- The third line of each test case contains N space-separated integers B_{1}, B_{2}, \ldots, B_{N} — where B_{i} is the number of comments on the i^{th} post.

------ Output Format ------ 

For each test case, output on a new line, an integer in the range 1 to N, denoting the index of the post which is most popular among the N posts.

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$1 ≤ N ≤ 10^{5}$
$1 ≤ A_{i}, B_{i} ≤ 2\cdot 10^{5}$
- The elements of array $B$ are distinct.
- It is guaranteed that the sum of $N$ over all test case does not exceed $2\cdot 10^{5}$.

----- Sample Input 1 ------ 
4
3
5 4 4
1 2 3
3
10 10 9
2 5 4
3
3 3 9
9 1 3
4
2 8 1 5
2 8 1 9

----- Sample Output 1 ------ 
1
2
3
2

----- explanation 1 ------ 
Test case $1$: The number of likes on the first post is greater than that of second and third post. Thus, the first post is most popular.

Test case $2$: The first and second post have maximum number of likes. But, the second post has more comments than the first post. Thus, the second post is most popular.

Test case $3$: The number of likes on the third post is greater than that of first and second post. Thus, the third post is most popular.

Test case $4$: The number of likes on the second post is greater than that of first, third, and fourth post. Thus, the second post is most popular.

Difficulty: EASY

Solutions:
for _ in range(int(input())):
	n = int(input())
	my_list = list(map(int, input().split()))
	your_list = list(map(int, input().split()))
	max_element = max(my_list)
	max_indices = [i for (i, element) in enumerate(my_list) if element == max_element]
	result = max([your_list[i] for i in max_indices])
	index = your_list.index(result)
	print(index + 1)


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	c = list(map(int, input().split()))
	maxl = max(l)
	maxc = 0
	if l.count(maxl) > 1:
		for j in range(len(l)):
			if l[j] == maxl:
				if c[j] > maxc:
					maxc = c[j]
		print(c.index(maxc) + 1)
	else:
		print(l.index(maxl) + 1)


for i in range(int(input())):
	n = int(input())
	list1 = list(map(int, input().split()))
	list2 = list(map(int, input().split()))
	k = max(list1)
	count = 0
	if list1.count(k) > 1:
		for j in range(len(list1)):
			if list1[j] == k:
				if list2[j] > count:
					count = list2[j]
		print(list2.index(count) + 1)
	else:
		print(list1.index(k) + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	x = max(a)
	z = a.index(x)
	y = b[a.index(x)]
	for i in range(z + 1, n):
		if a[i] == x and y < b[i]:
			y = b[i]
			z = i
	print(z + 1)


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	c = list(map(int, input().split()))
	w = []
	p = 0
	for (a, b) in zip(l, c):
		w.append((a, b, p))
		p += 1
	w.sort(key=lambda x: (x[0], x[1]), reverse=True)
	print(w[0][2] + 1)


for i in range(int(input())):
	x = int(input())
	list1 = list(map(int, input().split()))
	list2 = list(map(int, input().split()))
	maxi = max(list1)
	if list1.count(maxi) == 1:
		print(list1.index(maxi) + 1)
	else:
		ans = 0
		for i in range(x):
			if list1[i] == maxi:
				if list2[i] >= ans:
					ans = list2[i]
		print(list2.index(ans) + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	likes = max(a)
	p = []
	c = 0
	for i in range(n):
		if a[i] == likes:
			p.append(b[i])
			c += 1
	if c == 1:
		print(a.index(max(a)) + 1)
	else:
		print(b.index(max(p)) + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	x = max(a)
	y = []
	c = 0
	for i in range(n):
		if a[i] == x:
			c += 1
			y.append(i)
	if c <= 1:
		print(a.index(x) + 1)
	else:
		res = 0
		for i in y:
			if b[i] > res:
				res = b[i]
		print(b.index(res) + 1)


t = int(input())
for _ in range(t):
	n = list(map(int, input().split()))
	likes = list(map(int, input().split()))
	comm = list(map(int, input().split()))
	ma = max(likes)
	if likes.count(ma) > 1:
		m = 0
		for i in comm:
			if i > m and likes[comm.index(i)] == ma:
				m = i
		print(comm.index(m) + 1)
	else:
		print(likes.index(ma) + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	(maxa, maxb, resp) = (0, 0, 0)
	for i in range(n):
		if maxa < a[i] or (maxa == a[i] and maxb < b[i]):
			maxa = a[i]
			maxb = b[i]
			resp = i + 1
	print(resp)


for i in range(int(input())):
	n = int(input())
	lis = [int(x) for x in input().split()]
	li = [int(x) for x in input().split()]
	m = max(lis)
	c = 0
	if lis.count(m) > 1:
		for x in range(len(lis)):
			if lis[x] == m:
				if li[x] > c:
					c = li[x]
		print(li.index(c) + 1)
	else:
		print(lis.index(m) + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	m = max(a)

	def find(a, m):
		i = []
		for (idx, value) in enumerate(a):
			if value == m:
				i.append(idx)
		return i
	i = find(a, m)
	l = len(i)
	if l == 1:
		print(i[0] + 1)
	else:
		ma = 0
		for k in range(n):
			if k in i:
				if ma < b[k]:
					ma = b[k]
		print(b.index(ma) + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	maxl = max(a)
	if a.count(maxl) == 1:
		print(a.index(maxl) + 1)
	else:
		ans = 0
		for i in range(n):
			if a[i] == maxl:
				ans = max(ans, b[i])
		print(b.index(ans) + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	list_a = []
	x = max(a)
	for i in range(n):
		if a[i] == x:
			list_a.append(b[i])
	y = max(list_a)
	print(b.index(y) + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	mx = max(a)
	if a.count(mx) > 1:
		mxb = 0
		ind = -1
		for j in range(n):
			if a[j] == mx and b[j] > mxb:
				mxb = b[j]
				ind = j
		print(ind + 1)
	else:
		print(a.index(mx) + 1)


for i in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	x = max(A)
	b = 0
	if A.count(x) > 1:
		for j in range(n):
			if A[j] == x:
				if B[j] > b:
					b = B[j]
		print(B.index(b) + 1)
	else:
		print(A.index(x) + 1)


n = int(input())
for i in range(n):
	l = int(input())
	likes = list(map(int, input().split()))
	comme = list(map(int, input().split()))
	(max_index, max_like) = (0, 0)
	comme_index = 0
	flag = False
	for i in range(l):
		if likes[i] > max_like:
			max_like = likes[i]
			max_index = i
			comme_index = i
			flag = False
		elif likes[i] == max_like:
			flag = True
			if comme[comme_index] < comme[i]:
				comme_index = i
		else:
			continue
	print(max_index + 1 if not flag else comme_index + 1)


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	like = 0
	comment = 0
	ans = 0
	for i in range(n):
		if a[i] > like:
			like = a[i]
			comment = b[i]
			ans = i + 1
		elif a[i] == like and b[i] > comment:
			like = a[i]
			comment = b[i]
			ans = i + 1
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = max(a)
	l = []
	if a.count(c) == 1:
		print(a.index(c) + 1)
	else:
		for i in range(n):
			if c == a[i]:
				l.append(b[i])
		print(b.index(max(l)) + 1)


T = input()
for i in range(int(T)):
	N = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	l = []
	j = []
	c = max(A)
	h = 0
	k = 0
	for i in range(N):
		if A[i] == c:
			h = i
			l.append(h)
			k = k + 1
			h = 0
	for i in range(k):
		j.append(B[l[i]])
		p = max(j)
	for i in range(N):
		if B[i] == p:
			print(i + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = 0
	x = max(a)
	if a.count(x) > 1:
		for j in range(len(a)):
			if a[j] == x:
				if b[j] > c:
					c = b[j]
		print(b.index(c) + 1)
	else:
		print(a.index(x) + 1)


t = int(input())
for i in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	co = list(map(int, input().split()))
	ml = max(li)
	ma = []
	c = 0
	for m in range(0, n):
		if li[m] == ml:
			ma.append(co[m])
			c += 1
	if c == 1:
		p = li.index(max(li)) + 1
	else:
		p = co.index(max(ma)) + 1
	print(p)


t = int(input())
for i in range(t):
	a = int(input())
	l = list(map(int, input().split()))
	c = list(map(int, input().split()))
	maxl = 0
	maxc = 0
	for j in range(a):
		if l[j] > maxl:
			maxl = l[j]
			maxc = c[j]
			no = j + 1
		if l[j] == maxl:
			if c[j] > maxc:
				maxl = l[j]
				maxc = c[j]
				no = j + 1
	print(no)


t = int(input())
for i in range(t):
	n = int(input())
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	maxi = max(l1)
	count = 0
	l3 = []
	for i in range(0, n, 1):
		if l1[i] == maxi:
			count += 1
			l3.append(l2[i])
	if count == 1:
		print(l1.index(max(l1)) + 1)
	else:
		print(l2.index(max(l3)) + 1)


T = int(input())
for i in range(T):
	x = int(input())
	likes = list(map(int, input().split()))
	comm = list(map(int, input().split()))
	if len(set(likes)) == 1:
		cnt = 0
		mx = max(comm)
		for i in comm:
			cnt = cnt + 1
			if i >= mx:
				dis = cnt
		print(dis)
	else:
		cnt = 0
		mx = max(likes)
		cn = 0
		for i in likes:
			cnt = cnt + 1
			if i >= mx:
				if comm[cnt - 1] > cn:
					cn = comm[cnt - 1]
					dis = cnt
		print(dis)


t = int(input())
while t > 0:
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	max_like = max(a)
	max_comm = 0
	liked_post = 0
	if a.count(max_like) == 1:
		liked_post = a.index(max_like) + 1
	else:
		for i in range(len(a)):
			if a[i] == max_like:
				if b[i] > max_comm:
					max_comm = b[i]
					liked_post = i + 1
	print(liked_post)
	t -= 1


T = int(input())
for i in range(T):
	N = int(input())
	y = list(map(int, input().split()))
	u = list(map(int, input().split()))
	g = max(y)
	h = []
	q = []
	if y.count(g) == 1:
		print(y.index(g) + 1)
	elif y.count(g) > 1:
		for p in range(N):
			if y[p] == g:
				h.append(p)
		for j in h:
			q.append(u[j])
		t = max(q)
		print(u.index(t) + 1)


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	c = list(map(int, input().split()))
	k = max(l)
	a = []
	b = []
	for i in range(0, n):
		if l[i] == k:
			a.append(i)
	if len(a) == 1:
		print(a[0] + 1)
	else:
		for i in a:
			b.append(c[i])
		print(c.index(max(b)) + 1)


T = int(input())
for i in range(T):
	n = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	max_likes = max(A)
	ans = 0
	max_com = 0
	for i in range(n):
		if A[i] == max_likes:
			if max_com < B[i]:
				max_com = B[i]
				ans = i + 1
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	c = 0
	li = []
	m = max(A)
	for i in range(len(A)):
		if m == A[i]:
			li.append(B[i])
			c = c + 1
	if c == 1:
		print(A.index(m) + 1)
	else:
		n = max(li)
		print(B.index(n) + 1)


for i in range(int(input())):
	k = int(input())
	l = list(map(int, input().split()))
	s = list(map(int, input().split()))
	k = max(l)
	c = l.count(k)
	h = 0
	if c > 1:
		for i in range(len(l)):
			if k == l[i]:
				if s[i] > h:
					h = s[i]
		print(s.index(h) + 1)
	else:
		print(l.index(k) + 1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	c = list(map(int, input().split()))
	a = max(l)
	b = []
	ind = []
	if l.count(a) == 1:
		i = l.index(a)
		print(i + 1)
	else:
		for i in range(n):
			if l[i] == a:
				ind.append(i)
		for j in ind:
			e = c[j]
			b.append(e)
		for k in range(n):
			if c[k] == max(b):
				print(k + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	m = max(a)
	count = 0
	res = []
	for i in range(n):
		if a[i] == m:
			count += 1
			res.append(i)
	if count == 1:
		print(a.index(m) + 1)
	else:
		m1 = 0
		mIndex = 0
		for i in res:
			if b[i] > m1:
				m1 = b[i]
				mIndex = i
		print(mIndex + 1)


for _ in range(int(input())):
	number = int(input())
	LIST_ONE = list(map(int, input().split()))
	LIST_TWO = list(map(int, input().split()))
	MAXMIMUM_ELEMENT = max(LIST_ONE)
	MAXC = 0
	if LIST_ONE.count(MAXMIMUM_ELEMENT) > 1:
		for j in range(len(LIST_ONE)):
			if LIST_ONE[j] == MAXMIMUM_ELEMENT:
				if LIST_TWO[j] > MAXC:
					MAXC = LIST_TWO[j]
		print(LIST_TWO.index(MAXC) + 1)
	else:
		print(LIST_ONE.index(MAXMIMUM_ELEMENT) + 1)


for i in range(int(input())):
	N = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	maxa = max(A)
	maxb = 0
	if A.count(maxa) > 1:
		for j in range(len(A)):
			if A[j] == maxa:
				if B[j] > maxb:
					maxb = B[j]
		print(B.index(maxb) + 1)
	else:
		print(A.index(maxa) + 1)


def main(A, B, N):
	return max(zip(A, B, range(len(A))), key=lambda post: (post[0], post[1]))[2] + 1
try:
	for i in range(int(input())):
		N = int(input())
		A = list(map(int, input().split()))
		B = list(map(int, input().split()))
		print(main(A, B, N))
except EOFError as e:
	pass


def main(A, B, N):
	maxLikesIndex = 0
	maxLikes = A[0]
	for i in range(0, len(A)):
		if A[i] > maxLikes:
			maxLikes = A[i]
			maxLikesIndex = i
		elif A[i] == maxLikes:
			if B[i] > B[maxLikesIndex]:
				maxLikes = A[i]
				maxLikesIndex = i
	print(maxLikesIndex + 1)
try:
	for i in range(int(input())):
		N = int(input())
		A = list(map(int, input().split()))
		B = list(map(int, input().split()))
		main(A, B, N)
except EOFError as e:
	pass


T = int(input())
for i in range(T):
	N = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	a = sorted(A)
	maxf = []
	for j in range(N):
		if A[j] == a[-1]:
			maxf.append(B[j])
		else:
			continue
	print(B.index(max(maxf)) + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	j = 1
	likes = a[0]
	comments = b[0]
	while j < n:
		if a[j] == likes:
			if b[j] > comments:
				comments = b[j]
		elif a[j] > likes:
			likes = a[j]
			comments = b[j]
		j += 1
	print(b.index(comments) + 1)


for _ in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	m = max(l1)
	c = 0
	if l1.count(m) > 1:
		for i in range(len(l1)):
			if l1[i] == m:
				if l2[i] > c:
					c = l2[i]
		print(l2.index(c) + 1)
	else:
		print(l1.index(m) + 1)


for i in range(int(input())):
	n = int(input())
	l = [int(i) for i in input().split()]
	m = [int(i) for i in input().split()]
	k = max(l)
	com = -1
	anr = -1
	for i in range(len(l)):
		if l[i] == k:
			if com < m[i]:
				com = m[i]
				anr = i + 1
	print(anr)


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	c = list(map(int, input().split()))
	maxn = 0
	maxi = 0
	for j in range(len(l)):
		if l[j] > maxn:
			maxn = l[j]
			maxi = j
		elif maxn == l[j]:
			if c[j] > c[maxi]:
				maxn = l[j]
				maxi = j
	print(maxi + 1)


def facebook(n, a, b):
	ml = max(a)
	c = 0
	mc = []
	for i in range(n):
		if a[i] == ml:
			c += 1
			mc.append(b[i])
	if c == 1:
		return a.index(ml) + 1
	else:
		return b.index(max(mc)) + 1
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	print(facebook(n, a, b))


for _ in range(int(input())):
	n = int(input())
	arra = list(map(int, input().split()))
	arrb = list(map(int, input().split()))
	m = max(arra)
	arrc = zip(arra, arrb)
	(maxc, ind) = (0, 0)
	for (i, (a, b)) in enumerate(arrc, start=1):
		if a == m:
			if b > maxc:
				maxc = b
				ind = i
	print(ind)


for i in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	if l1.count(max(l1)) == 1:
		print(l1.index(max(l1)) + 1)
	else:
		l = []
		res = 0
		m = 0
		ma = max(l1)
		for j in range(len(l1)):
			if l1[j] == ma:
				if l2[j] > m:
					m = l2[j]
					res = j + 1
		print(res)


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


for T in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	maxLike = 0
	index_maxLike = []
	for i in range(len(a)):
		if a[i] > maxLike:
			maxLike = a[i]
			index_maxLike = [i]
		elif a[i] == maxLike:
			index_maxLike.append(i)
		else:
			pass
	if len(index_maxLike) == 1:
		print(index_maxLike[0] + 1)
	else:
		maxC = 0
		maxI = -1
		for i in index_maxLike:
			if b[i] > maxC:
				maxC = b[i]
				maxI = i
		print(maxI + 1)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().strip().split()))
	b = list(map(int, input().strip().split()))
	max_l = 0
	max_c = 0
	outut = 0
	for i in range(n):
		if max_l < a[i]:
			max_l = a[i]
			max_c = b[i]
			output = i + 1
		elif a[i] == max_l and b[i] > max_c:
			max_l = a[i]
			max_c = b[i]
			output = i + 1
	print(output)


t = int(input())
for i in range(t):
	n = int(input())
	inp = input()
	inpu = input()
	l = inp.split()
	c = inpu.split()
	index = 0
	m = 0
	for j in range(n):
		l[j] = int(l[j])
	for j in range(n):
		c[j] = int(c[j])
	for k in range(len(l)):
		if m < l[k]:
			m = l[k]
			index = k
	if l.count(m) == 1:
		print(index + 1)
	elif l.count(m) != 1:
		com = 0
		inde = 0
		for f in range(len(c)):
			if m == l[f]:
				if com < c[f]:
					com = c[f]
					inde = f
		print(inde + 1)


for i in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	li1 = list(map(int, input().split()))
	m = max(li)
	c = 0
	j = 0
	for i in range(n):
		if li[i] == m:
			if li1[i] > c:
				c = li1[i]
				j = i
	print(j + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	index = []
	num = max(a)
	max_com = -1
	for i in range(n):
		if a[i] == num:
			if b[i] > max_com:
				max_com = b[i]
	print(b.index(max_com) + 1)


tc = int(input())
for _ in range(tc):
	n = int(input())
	likes = list(map(int, input().split()))
	comments = list(map(int, input().split()))
	len1 = len(likes)
	ml = max(likes)
	mc = -1
	for i in range(len1):
		if likes[i] == ml:
			if comments[i] > mc:
				mc = comments[i]
	print(comments.index(mc) + 1)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	z = []
	k = max(a)
	for i in range(n):
		if a[i] == k:
			z.append(b[i])
	p = max(z)
	print(b.index(p) + 1)


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	m = 0
	mc = 0
	ans = 0
	for i in range(n):
		if l[i] > m:
			m = l[i]
			mc = l2[i]
			ans = i + 1
		elif l[i] == m and l2[i] > mc:
			m = l[i]
			mc = l2[i]
			ans = i + 1
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	max_like = 0
	max_comment = 0
	ans = 0
	for i in range(n):
		if a[i] > max_like:
			max_like = a[i]
			max_comment = b[i]
			ans = i + 1
		elif a[i] == max_like and b[i] > max_comment:
			max_like = a[i]
			max_comment = b[i]
			ans = i + 1
	print(ans)


for i in range(int(input())):
	x = int(input())
	v = input().split()
	b = input().split()
	l = []
	ll = []
	for i in v:
		i = int(i)
		l.append(i)
	for i in b:
		i = int(i)
		ll.append(i)
	k = l.copy()
	k.sort()
	h = []
	f = 0
	for i in l:
		if i == k[-1]:
			f = f + 1
	if f == 1:
		c = 1
		for i in l:
			if i == k[-1]:
				break
			c = c + 1
		print(c)
	else:
		k = l.copy()
		k.sort()
		c = 0
		m = 0
		for i in l:
			if i == k[-1]:
				if ll[c] > m:
					m = ll[c]
					n = c + +1
			c = c + 1
		print(n)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	m = max(a)
	c = 0
	l = []
	for j in range(n):
		if a[j] == m:
			c += 1
			l.append(b[j])
	if c == 1:
		print(a.index(m) + 1)
	else:
		print(b.index(max(l)) + 1)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	ai = 0
	for j in range(1, n):
		if a[j] > a[ai]:
			ai = j
		elif a[j] == a[ai]:
			if b[j] > b[ai]:
				ai = j
	print(ai + 1)


t = int(input())
for i in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	ai = 0
	for j in range(1, n):
		if A[j] > A[ai]:
			ai = j
		elif A[j] == A[ai]:
			if B[j] > B[ai]:
				ai = j
	print(ai + 1)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	x = 0
	y = 0
	ans = 0
	for i in range(n):
		if a[i] > x:
			x = a[i]
			y = b[i]
			ans = i + 1
		elif a[i] == x and b[i] > y:
			x = a[i]
			y = b[i]
			ans = i + 1
	print(ans)


import numpy as g
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().strip().split()))[:n]
	b = list(map(int, input().strip().split()))[:n]
	c = 0
	a1 = g.array(a)
	maxind = g.where(a1 == max(a))
	c = len(maxind[0])
	if c == 1:
		print(a.index(max(a)) + 1)
	else:
		p = [b[k] for k in maxind[0]]
		print(b.index(max(p)) + 1)


t = int(input())
for i in range(t):
	n = int(input())
	lst = list(map(int, input().split()))
	com = list(map(int, input().split()))
	maxx = max(lst)
	temp = []
	flag = 0
	for i in range(n):
		if lst[i] == maxx:
			flag += 1
			temp.append(com[i])
	if flag != 1:
		ans = com.index(max(temp))
		print(ans + 1)
	else:
		print(lst.index(max(lst)) + 1)