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 g in ab:
    dis = 2*(10**8)
    point = 0
    for c in range(m):
        d = abs(g[0]-cd[c][0]) + abs(g[1]-cd[c][1])
        if(dis > d):
            dis = d
            point = c + 1
    print(point)
