N, M = map(int, input().split(" "))

student = [];
pos = [];
for i in range(N) :
	a, b = map(int, input().split(" "))
	student.append((a, b))

for i in range(M) :
	a, b = map(int, input().split(" "))
	pos.append((a,b))

for st in student :
	ans = -1;
	score = 100000000;
	for i in range(M) :
		tmpscore = abs(st[0] - pos[i][0]) + abs(st[1] - pos[i][1])
		if score > tmpscore :
			score = tmpscore;
			ans = i;
	print(ans+1);
