import math

def getDist(a,b,c,d):
  return abs(a-c) + abs(b-d)
def findSmallest(student, checkPoints):
  [a,b] = student
  shortest = math.inf
  index = 1
  for checkPoint in checkPoints:
    [c,d] = checkPoint
    dist = getDist(a,b,c,d)
    if dist < shortest:
      shortest = dist
      indexAns = index
    index += 1
  return indexAns

n,m=[int(x) for x in input().split()]
students = []
for x in range(n):
  students.append([int(x) for x in input().split()])
checkPoints = []
for x in range(m):
  checkPoints.append([int(x) for x in input().split()])

for student in students:
  print(findSmallest(student, checkPoints[:]))
  

  """
1 2
2 0
-1 0
1 0
  """