import io.StdIn

object Main extends App {
  val out = new java.io.PrintWriter(System.out)
  val Array(n, m) = StdIn.readLine.split(" ").map(_.toInt)
  val st = Iterator.continually(StdIn.readLine)
    .take(n)
    .map(_.split(" ").map(_.toInt))
    .toArray
  val cp = Iterator.continually(StdIn.readLine)
    .take(m)
    .map(_.split(" ").map(_.toInt))
    .toArray

  val ans = st.map(es => {
    cp./:(Int.MaxValue, 0, 0)((min, ep) => {
      val d = (es(0) - ep(0)).abs + (es(1) - ep(1)).abs
      if(min._1 > d) (d, min._3 + 1, min._3 + 1)
      else (min._1, min._2, min._3 + 1)
    })._2
  })

  ans.foreach(out.println)
  out.flush
}