N, M = map(int, raw_input().split())

a = []
b = []
for i in range(N):
    temp1, temp2 = map(int, raw_input().split())
    a.append(temp1)
    b.append(temp2)

c = []
d = []
for i in range(M):
    temp1, temp2 = map(int, raw_input().split())
    c.append(temp1)
    d.append(temp2)

result = []

for student in range(N):
    maxDistance = 0
    closePoint = 0
    for point in range(M):
        distance = abs(c[point] - a[student]) + abs(d[point] - b[student])
        if point == 0 or distance < maxDistance:
            maxDistance = distance
            closePoint = point + 1
    result.append(closePoint)

for c in result:
    print(c)