def manhattan(s, c):
	x = abs(s[0] - c[0])
	y = abs(s[1] - c[1])
	return x + y

inpt = map(int, raw_input().split())

student = []
checkpoint = []

for i in range(0, inpt[0]):
	student.append(map(int, raw_input().split()))

for i in range(0, inpt[1]):
	checkpoint.append(map(int, raw_input().split()))
	
for i in range(0, inpt[0]):
	tmp = 0
	minimum = 200000001
	for j in range(0, inpt[1]):
		mnh = manhattan(student[i], checkpoint[j])
		if mnh < minimum:
			tmp = j + 1
			minimum = mnh
	print tmp