n = int(eval(input()))

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

diff_list = [abs(t-h_i*0.006-a) for h_i in map(int, input().split())]

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

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



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



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

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

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