import numpy as np

def manhattan(x,y):
    return np.abs(x[0]-y[0]) + np.abs(x[1]-y[1])

N,M = map(int,raw_input().split())
students = np.zeros((N,2))
checkpoints = np.zeros((M,2))
for i in range(N):
    students[i][0],students[i][1] = map(int,raw_input().split())
#print a
for j in range(M):
    checkpoints[j][0],checkpoints[j][1] = map(int,raw_input().split())

min = 100
index = np.zeros(N)
for i in range(N):
    for j in range(M):
        d = manhattan(students[i],checkpoints[j])
        if min > d:
            min = d
            index[i] = j
    print (index[i]+1).astype(np.int32)