# ABC 057: B – Checkpoints
studentPoints = []
checkPoints = []
n, m = map(int, input().split())
for _ in range(n):
    studentPoints.append([int(s) for s in input().split()])
for _ in range(m):
    checkPoints.append([int(s) for s in input().split()])

for i in range(n):
    distances = [abs(studentPoints[i][0] - checkPoints[k][0]) + abs(studentPoints[i][1] - checkPoints[k][1]) for k in range(m)]
    target = distances.index(min(distances))
    print(target + 1)
    m -= 1