import scala.io.StdIn

object Main extends App {

  case class Point(index: Int, x: Int, y: Int)

  val Array(n, m) = StdIn.readLine().split(" ").map(_.toInt)

  val students = (0 until n).map { i =>
    val pa = StdIn.readLine().split(" ").map(_.toInt)
    Point(i, pa(0), pa(1))
  }

  val checkpoints = (0 until n).map { i =>
    val pa = StdIn.readLine().split(" ").map(_.toInt)
    Point(i + 1, pa(0), pa(1))
  }

  import scala.math.abs
  def distance(s: Point, e: Point) = abs(e.x - s.x) + abs(e.y - s.y)

  val r = students.map{ si =>
    checkpoints.foldLeft(distance(si, checkpoints(0)),checkpoints(0)){ (acc, ci) =>
      val temp = distance(si, ci)
      if(acc._1 > temp) (temp, ci)
      else acc
    }._2.index
  }
  
  r.foreach(println)

}