# coding: utf-8
def calculate_distance(x1, y1, x2, y2):
    return abs(x1 - x2) + abs(y1 - y2)

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

students = []
for student in range(N):
    x, y = map(int, input().split())
    students.append([x, y])

checkpoints = []
for point in range(M):
    x, y = map(int, input().split())
    checkpoints.append([x, y])

for s in students:
    pointnumber = 0
    minpoint = 0
    d = 200000000
    for cp in checkpoints:
        pointnumber += 1
        caldis = calculate_distance(s[0], s[1], cp[0], cp[1])
        if d > caldis:
            d = caldis
            minpoint = pointnumber
    print(minpoint)