N,M = map(int,input().split())
students = []
points = []
for i in range(N):
  students.append(list(map(int,input().split())))
for j in range(M):
  points.append(list(map(int,input().split())))
for k in range(N):
  Q = 999999999999999
  for l in range(M):
    x_ = students[k,0]-points[l,0]
    y_ = students[k,1]-points[l,0]
    if (x_<0):
      x_ = x_ *(-1)
    if (y_<0):
      y_ = y_ *(-1)
    L = x_ + y_
    z = 0
    if(L<Q):
      Q = L
      z = l+1
    else:
      None
  print(z)
      
    
  