n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]

for a, b in ab:
    res = 10**8
    for i in range(m):
        (c, d) = cd[i]
        dist = abs(a-c)+abs(b-d)
        if dist < res:
            ans = i
        res = min(res, dist)
    print(ans+1)