counter = 1
while True:
	counter += 1
	poolSize = int(input())
	pool = []
	for i in range(poolSize):
		pool.append(int(input()))

	numObj = int(input())
	obj = []
	for i in numObj:
		obj.append(int(input()))
