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

def dist(x, y):
    return abs(x[0]-y[0])+abs(x[1]-y[1])


for student in students:
    mini = [1000000, -1]
    for i in range(m):
        if dist(student,checkpoints[i]) < mini[0]:
            mini = [dist(student, checkpoints[i]),i]
    print(mini[1]+1)
