N, M = map(int, input().split())
a, b, c, d = [0] * N, [0] * N, [0] * M, [0] * M
for i in range(N):
	a[i], b[i] = map(int, input().split())
for i in range(M):
	c[i], d[i] = map(int, input().split())

for j in range(N):
	for k in range(M - 1, -1, -1):
		ans = "nan"
		diff = float("inf")
		if abs(a[j] - c[k]) + abs(b[j] - d[k]) < diff:
			diff = abs(a[j] - c[k]) + abs(b[j] - d[k])
			ans = k
	print(k + 1)
