N,M=map(int,raw_input().split())
xs=[]
cs=[]
for i in xrange(N):
  x=map(int,raw_input().split())
  xs.append(x)
for i in xrange(M):
  c=map(int,raw_input().split())
  cs.append(c)
for x in xs:
  cp = -1
  cd = 1e9
  for j,c in enumerate(cs):
    md = abs(c[0]-x[0]) + abs(c[1]-x[1])
    if md < cd:
      cd = md
      cp = j
  print 1+cp
