import math

n, m = map(int, input().split())

# student input
student = []
for i in range(n):
    a, b = map(int, input().split())
    student.append([a, b])

# check point input
check = []
for j in range(n):
    c, d = map(int, input().split())
    check.append([c, d])

# calc
for s in student:
    distance = 10e9
    near = 0
    for index, k in enumerate(check):
        v = math.fabs(s[0] - k[0]) + math.fabs(s[1] - k[1])
        if v < distance:
            distance = v
            near = index + 1
    print(near)
