import sys
import numpy as np

N, M = (int(i) for i in input().split(" "))
S = [input().split(" ") for i in range(N + M)]

seito = S[0:N]
check = S[N:N+M]

kyori = np.zeros(M)

for j in range(0,N):
	for i in range(0,M):
		kyori[i] = abs(int(seito[j][0]) - int(check[i][0])) + abs(int(seito[j][1]) - int(check[i][1]))
	#kyoriが一番低いiを出力する

	num = np.argmin(kyori)
	print(num)



