def distance(s, g):
	return abs(s[0]-g[0]) + abs(s[1]-g[1])

def searchpoint(student, lst):
	min = 1000000000
	ans = -1
	for i in range(0, len(lst)):
		tmp = distance(student, lst[i])
		if tmp < min:
			min = tmp
			ans = i + 1
	return ans

N, M = map(int, raw_input().split())
student = []
for i in range(0, N):
	student.append(map(int, raw_input().split()))
checkpoint = []
for i in range(0, M):
	checkpoint.append(map(int, raw_input().split()))
for i in range(0, N):
	print searchpoint(student[i], checkpoint)