n, m = map(int, input().split())
students = [list(map(int, input().split())) for i in range(n)]

targets = [list(map(int, input().split())) for i in range(m)]
x = 0
snumber = [(0, x)] * n
  
def md(s, t):
  d = abs(s[0] - t[0]) + abs(s[1] - t[1])
  return d

for i in range(n):
  x = 2 * 10 ** 8
  min_pos = 0
  for j in range(m):  
    dist = md(students[i], targets[j])
    if x > dist:
      x = dist
      min_pos = j + 1
      
    
  print(min_pos)