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)]
dist = 10**9


for i, j in ab:
    for k in range(n):
        dist1 = abs(i - cd[k][0]) + abs(j - cd[k][1])
        if dist1 < dist:
            dist = dist1
            ch = k + 1
    print(ch)
    dist = 10**9