n, m = map(int, input().split())
AB = [[int(i) for i in input().split()] for i in range(n)]
CD = [[int(i) for i in input().split()] for i in range(m)]

for ab in AB:
    dist = [abs(ab[0] - cd[0]) + abs(ab[1] - cd[1]) for cd in CD]
    print(dist.index(min(dist)) + 1)