N, M = map(int, input().strip().split())

a_b = []
for i in range(N):
    array = list(map(int, input().strip().split()))
    a_b.append(array)

c_d = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    c_d.append(array)

for n in range(N):
    mind = 200000001
    for m in range(M):
        dist = abs(a_b[n][0] - c_d[m][0]) + abs(a_b[n][1] - c_d[m][1])
        if dist < mind:
            mind = dist
            checkpoint = m + 1
    print(checkpoint)
