n, m = map(int, raw_input().split())
lx, ly, lxx, lyy = [], [], [], []
for i in range(n):
	x, y = map(int, raw_input().split())
	lx.append(x)
	ly.append(y)

for i in range(m):
	x, y = map(int, raw_input().split())
	lxx.append(x)
	lyy.append(y)

for i in range(n):
	mi = 10000000000
	note = 0
	for j in range(m):
		if abs(lx[i] - lxx[j]) + abs(ly[i] - lyy[j]) < mi:
			mi = abs(lx[i] - lxx[j]) + abs(ly[i] - lyy[j])
			note = j + 1
	print note