#ABC057B

n,m=map(int,raw_input().split())
ab=[]
for i in xrange(n):
 a,b=map(int,raw_input().split())
 ab.append([a,b])
cd=[]
for i in xrange(m):
 c,d=map(int,raw_input().split())
 cd.append([c,d])

for i in xrange(n):
 res=-1
 lm=10**9
 for j in xrange(m):
  l=abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
  if l<lm:
   lm=l
   res=j
 print res+1
