N, M = map(int, input().split())
students = []
checkpoints = []
for i in range(N):
    students.append(list(map(int,input().split())))
for i in range(M):
    checkpoints.append(list(map(int, input().split())))

for sx, sy in students:
    mindist = 10 ** 8 + 1
    num = 0
    for i in range(M):
        cx, cy = checkpoints[i]
        dist = abs(sx-cx) + abs(sy-cy)
        if mindist > dist:
            mindist = dist
            num = i
    print(num+1)
