n,m = map(int,input().split())
N = [list(map(int, input().split())) for _ in range(n)]
M = [list(map(int, input().split())) for _ in range(m)]

def kyori(X,Y):
    return abs(X[0]-Y[0])+abs(X[1]-Y[1])

def near_p(hito):
    temp = []
    for _ in range(n):
        temp.append(kyori(hito,M[_]))
    return temp.index(min(temp))+1

for i in range(n):
    print(near_p(N[i]))
