n=int(eval(input()))

t,a=list(map(int,input().split()))

h=list(map(int,input().split()))

z=[abs(t-x*0.006-a) for x in h]

print((z.index(min(z))+1))
n = int(eval(input()))

T,A = list(map(int, input().split()))

H = list(map(int, input().split()))

z = [abs(A - (T - h*0.006)) for h in H]

print(( z.index(min(z)) +1 ))
n = int(eval(input()))
t, a = list(map(int, input().split()))
h = list(map(int, input().split()))
z = [abs(t - x * 0.006 - a) for x in h]
print((z.index(min(z)) + 1))

n = int(eval(input()))
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))
z = [abs(A - (T - h * 0.006)) for h in H]
print((z.index(min(z)) + 1))

-t, a = list(map(int, input().split())) -h = list(map(int, input().split())) -z = [abs(t - x * 0.006 - a) for x in h] +T, A = list(map(int, input().split())) +H = list(map(int, input().split())) +z = [abs(A - (T - h * 0.006)) for h in H]