import math
n,m=map(int,raw_input().split())
a=[]
b=[]
for i in range(n):
	ia,ib=map(int,raw_input().split())
	a.append(ia)
	b.append(ib)
c=[]
d=[]
for i in range(m):
	ic,id=map(int,raw_input().split())
	c.append(ic)
	d.append(id)
for i in range(n):
	dist=10**9
	ans=0
	for j in range(m):
		ndist=abs(a[i]-c[j])+abs(b[i]-d[j])
		if ndist<dist:
			dist=ndist
			ans=j+1
	print ans
