N,M = map(int,input().split())

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

index_list = []
for i in range(N):
    min_dist = 10000
    for j in range(M):
        dist = abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
        if dist<min_dist:
            min_dist = dist
            index=j
    index_list.append(index)

for i in index_list:
    print(i+1)