N,M = (int(i) for i in input().split())


student = []
for i in range(N):
    a,b = (int(i) for i in input().split())
    student.append([a,b])

point = []
for j in range(M):
    c,d = (int(i) for i in input().split())
    point.append([c,d])

minimum = N*[""]
number = N*[0]



for i in range(N):
    minimum[i] = abs(student[i][0]-point[0][0]) + abs(student[i][1]-point[0][1])
    for j in range(M):
        distance = abs(student[i][0]-point[j][0]) + abs(student[i][1]-point[j][1])
        if distance<= minimum[i]:
            number[i] = j+1
        minimum[i] = min(distance,minimum[i])

for i in range(N):
	print(number[i])
