n, m = map(int, input().split())

students = [tuple(map(int, input().split())) for i in range(n)]
checkpoints = [tuple(map(int, input().split())) for j in range(m)]

def distance(u, v):
    return abs(u[0] - v[0]) + abs(u[1] - v[1])


for s in students:
    j = -1
    v = 2*10**8+1
    for i, cp in enumerate(checkpoints):
        d = distance(s, cp)
        if d < v:
            j = i
            v = d
    print(j+1)


