N, M = map(int, input().split())
students = [list(map(int, input().split())) for i in range(N)]
checkpoints = [list(map(int, input().split())) for i in range(M)]

for s in students:
    min_distance = 2 * 10**8 + 1
    for i, c in enumerate(checkpoints):
        distance = abs(s[0] - c[0]) + abs(s[1]- c[1]) 
        if min_distance > distance:
            min_distance = distance
            point = i+1
    print(point)