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

for i in range(n):
	a, b = map(int, input().split())
	ans = 0
	fdif = abs(a-cd[0][0]) + abs(b-cd[0][1])
	for j in range(m):
		dif = abs(a - cd[j][0]) + abs(b - cd[j][1])
		if fdif > dif:
			ans = j+1
			break
	print(ans)
