import math
def distance(x, y, i, j):
    return abs(x - i) + abs(y - j)

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

for i in student:
    mini = 100000
    minicp = 0
    for k in range(M):
        j = checkpoint[k]
        if distance(i[0], i[1], j[0], j[1]) < mini:
            mini = distance(i[0], i[1], j[0], j[1])
            minicp = k + 1
    print(minicp)
