n = int(eval(input()))

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

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

H = [abs(t-a-x * 6e-3) for x in h]

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

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

lst = [ abs((t - i * 0.006)-a) for i in list(map(int, input().split()))]

print((lst.index(min(lst)) + 1))

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

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

-h = list(map(int, input().split())) -H = [abs(t - a - x * 6e-3) for x in h] -print((1 + H.index(min(H)))) +lst = [abs((t - i * 0.006) - a) for i in list(map(int, input().split()))] +print((lst.index(min(lst)) + 1))