n, m = map(int, raw_input().split())
a = []
c = []
for i in range(n):
	a.append(map(int, raw_input().split()))
for j in range(m):
	c.append(map(int, raw_input().split()))

for i in range(n):
	dist0 = 999999999
	j0 = 999
	for j in range(m):
		dist = abs(a[i][0]-c[j][0]) + abs(a[i][1]-c[j][1])
		if dist < dist0:
			dist0 = dist
			j0 = j
	print j0 + 1