from typing import Tuple, List


def manhattan_distance(p: Tuple[int, int], q: Tuple[int, int]) -> int:
    return abs(p[0] - q[0]) + abs(p[1] - q[1])


N, M = map(int, input().split())
students: List[Tuple[int, int]] = [tuple(map(int, input().split())) for _ in range(N)]
checkpoints: List[Tuple[int, int]] = [tuple(map(int, input().split())) for _ in range(M)]

for student in students:
    p = min([(manhattan_distance(student, checkpoint), idx) for idx, checkpoint in enumerate(checkpoints, start=1)])
    print(p[1])
