n, m = map(int, input().split())
s = [list(map(int, input().split())) for _ in range(n)]
p = [list(map(int, input().split())) for _ in range(m)]
for i in range(n):
    mindis = 10 ** 9
    for j in range(m):
        dis = abs(s[i][0] - p[j][0]) + abs(s[i][1] - p[j][1])
        if mindis > dis:
            p = j+1
            mindis = dis
    print(p)