import sequtils, strutils, algorithm, math, future, sets, tables, hashes


proc manh(a,b,x,y : int) : int = 
   return abs(a - x) + abs(b - y)

proc solve() =
   
   var n,m : int
   (n,m) = stdin.readLine.split.map(parseInt)
   var 
      a = newSeq[int](n)
      b = newSeq[int](n)
      c = newSeq[int](m)
      d = newSeq[int](m)
   for i in 0 ..< n : 
      (a[i], b[i]) = stdin.readLine.split.map(parseInt)
   for i in 0 ..< m : 
      (c[i], d[i]) = stdin.readLine.split.map(parseInt)

   for i in 0 ..< n : 
      var mini = 10000000
      var minv = 10000000
      for j in 0 ..< m :
         var dist = manh(a[i], b[i], c[j], d[j]) 
         if dist < minv : 
            mini = j + 1
            minv = dist
      echo mini 

solve()