import math

class Point:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def distanceTo(self, point):
        dist = math.fabs(self.x - point.x) + math.fabs(self.y - point.y)
        return dist

students = []
checkpoints = []

N, M = map(int, raw_input().split(" "))
for i in range(0, N):
    x, y = map(int, raw_input().split(" "))
    students.append(Point(x, y))

for i in range(0, M):
    x, y = map(int, raw_input().split(" "))
    checkpoints.append(Point(x, y))


for student in students:
    minDist = 1000000000
    minIndex = 0
    for i in range(0, M):
        dist = student.distanceTo(checkpoints[i])
        if dist < minDist:
            minDist = dist
            minIndex = i
    print minIndex + 1