import io.StdIn.readLine
object Main extends App {
  val Array(n, m) = readLine.split(" ").map(_.toInt)
  val abs = Seq.fill(n)(readLine.split(" ").map(_.toInt) match {
    case Array(a, b) => (a, b)
  })
  val cds = Seq.fill(m)(readLine.split(" ").map(_.toInt) match {
    case Array(c, d) => (c, d)
  })

  abs foreach {
    case (a, b) =>
    ((-1, 100000000000000000L) /: (cds zipWithIndex)) {
      case ((q, dist), ((c, d), i)) =>
      val newDist = (a - c).abs + (b - d).abs
      if (newDist < dist) (i, newDist)
      else (q, dist)
    } match {
      case (q, dist) =>
      println(q + 1)
    }
  }
}
