n,m=map(int,input().split())
st=[]
ch=[]
def mht(a,b):
  return abs(a[0]-b[0])+abs(a[1]-b[1])
for i in range(n):
  st.append(list(map(int,input().split())))
for i in range(m):
  ch.append(list(map(int,input().split())))
  
for i in st:
  mn=100000000
  for (j,k) in zip(ch,range(m)):
    mh=mht(i,j)
    if mh<mn:
      mn=mh
      nm=k+1
  print(nm)