N, M = map(int, raw_input().split())
P = [map(int, raw_input().split()) for _ in range(N)]
Q = [map(int, raw_input().split()) for _ in range(M)]

for x1, y1 in P:
    dist = 10 ** 9
    ans = -1
    for i, (x2, y2) in enumerate(Q):
        if abs(x1 - x2) + abs(y1 - y2) < dist:
            dist = abs(x1 - x2) + abs(y1 - y2)
            ans = i + 1
    print ans
