N, M = map(int, input().split())
S = [list(map(int, input().split())) for _ in range(N)]
C = [list(map(int, input().split())) for _ in range(N)]

for s in S:
    minC = 10**10
    idx = 0
    for i, c in enumerate(C):
        d = abs(s[0]-c[0]) + abs(s[1]-c[1])
        if d < minC:
            minC = d
            idx = i + 1
    print(idx)


