output_description: Print N lines.  
  The i-th line (1 \leq i \leq N) should contain the index of the checkpoint for
  the i-th student to go.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N M
      a_1 b_1
      :  
      a_N b_N
      c_1 d_1
      :  
      c_M d_M
attempt: import sys
  import math
  import collections
  import itertools
  import array
  import inspect
  
  # Set max recursion limit
  sys.setrecursionlimit(1000000)
  
  
  # Debug output
  def chkprint(*args):
      names = {id(v): k for k, v in inspect.currentframe().f_back.f_locals.items()}
      print(", ".join(names.get(id(arg), "???") + " = " + repr(arg) for arg in args))
  
  
  # Binary converter
  def to_bin(x):
      return bin(x)[2:]
  
  
  def li_input():
      return [int(_) for _ in input().split()]
  
  
  def gcd(n, m):
      if n % m == 0:
          return m
      else:
          return gcd(m, n % m)
  
  
  def gcd_list(L):
      v = L[0]
  
      for i in range(1, len(L)):
          v = gcd(v, L[i])
  
      return v
  
  
  def lcm(n, m):
      return (n * m) // gcd(n, m)
  
  
  def lcm_list(L):
      v = L[0]
  
      for i in range(1, len(L)):
          v = lcm(v, L[i])
  
      return v
  
  
  # Width First Search (+ Distance)
  def wfs_d(D, N, K):
      """
      D: 隣接行列(距離付き)
      N: ノード数
      K: 始点ノード
      """
  
      dfk = [-1] * (N + 1)
      dfk[K] = 0
  
      cps = [(K, 0)]
      r = [False] * (N + 1)
      r[K] = True
      while len(cps) != 0:
          n_cps = []
          for cp, cd in cps:
              for i, dfcp in enumerate(D[cp]):
                  if dfcp != -1 and not r[i]:
                      dfk[i] = cd + dfcp
                      n_cps.append((i, cd + dfcp))
                      r[i] = True
  
          cps = n_cps[:]
  
      return dfk
  
  
  # Depth First Search (+Distance)
  def dfs_d(v, pre, dist):
      """
      v:  現在のノード
      pre: １つ前のノード
      dist: 現在の距離
  
      以下は別途用意する
      D: 隣接リスト(行列ではない)
      D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
      """
  
      global D
      global D_dfs_d
  
      D_dfs_d[v] = dist
  
      for next_v, d in D[v]:
          if next_v != pre:
              dfs_d(next_v, v, dist + d)
  
      return
  
  
  def sigma(N):
      ans = 0
      for i in range(1, N + 1):
          ans += i
      return ans
  
  
  def comb(n, r):
      if n - r < r:
          r = n - r
      if r == 0:
          return 1
      if r == 1:
          return n
  
      numerator = [n - r + k + 1 for k in range(r)]
      denominator = [k + 1 for k in range(r)]
  
      for p in range(2, r + 1):
          pivot = denominator[p - 1]
          if pivot > 1:
              offset = (n - r) % p
              for k in range(p - 1, r, p):
                  numerator[k - offset] /= pivot
                  denominator[k] /= pivot
  
      result = 1
      for k in range(r):
          if numerator[k] > 1:
              result *= int(numerator[k])
  
      return result
  
  
  def bisearch(L, target):
      low = 0
      high = len(L) - 1
  
      while low <= high:
          mid = (low + high) // 2
          guess = L[mid]
          if guess == target:
              return True
          elif guess < target:
              low = mid + 1
          elif guess > target:
              high = mid - 1
      if guess != target:
          return False
  
  
  # --------------------------------------------
  
  dp = None
  
  
  def calc_distance(s, p):
      x, y = s
      x_, y_ = p
  
      return abs(x - x_) + abs(y - y_)
  
  
  def main():
      N, M = li_input()
      S = [li_input() for _ in range(N)]
      P = [li_input() for _ in range(M)]
  
      for s in S:
          ans_d = -1
          ans_i = -1
          for i, p in enumerate(P, start=1):
              d = calc_distance(s, p)
  
              if ans_d == -1 or d < ans_d:
                  ans_d = d
                  ans_i = i
  
          print(ans_i)
  
  
  main()
  
problem_description: Statement
  
  There are N students and M checkpoints on the xy-plane.  
  The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the
  coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j).  
  When the teacher gives a signal, each student has to go to the nearest
  checkpoint measured in _Manhattan distance_.  
  The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is
  |x_1-x_2|+|y_1-y_2|.  
  Here, |x| denotes the absolute value of x.  
  If there are multiple nearest checkpoints for a student, he/she will select
  the checkpoint with the smallest index.  
  Which checkpoint will each student go to?
samples: [{"input": "2 2\n    2 0\n    0 0\n    -1 0\n    1 0", "output": "2\n    1\n    \n\nThe Manhattan distance between the first student and each checkpoint is:\n\n  * For checkpoint 1: |2-(-1)|+|0-0|=3\n  * For checkpoint 2: |2-1|+|0-0|=1\n\nThe nearest checkpoint is checkpoint 2. Thus, the first line in the output\nshould contain 2.\n\nThe Manhattan distance between the second student and each checkpoint is:\n\n  * For checkpoint 1: |0-(-1)|+|0-0|=1\n  * For checkpoint 2: |0-1|+|0-0|=1\n\nWhen there are multiple nearest checkpoints, the student will go to the\ncheckpoint with the smallest index. Thus, the second line in the output should\ncontain 1.\n\n* * *"}, {"input": "3 4\n    10 10\n    -10 -10\n    3 3\n    1 2\n    2 3\n    3 5\n    3 5", "output": "3\n    1\n    2\n    \n\nThere can be multiple checkpoints at the same coordinates.\n\n* * *"}, {"input": "5 5\n    -100000000 -100000000\n    -100000000 100000000\n    100000000 -100000000\n    100000000 100000000\n    0 0\n    0 0\n    100000000 100000000\n    100000000 -100000000\n    -100000000 100000000\n    -100000000 -100000000", "output": "5\n    4\n    3\n    2\n    1"}]