object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N, M = sc.nextInt()
  val abs = List.fill(N)(sc.nextInt() -> sc.nextInt())
  val cds = List.fill(M)(sc.nextInt() -> sc.nextInt()).zipWithIndex
  abs.map { case (a, b) =>
    cds.minBy { case ((c, d), _) =>
      math.abs(a - c) + math.abs(b - d)
    }._2 + 1
  }.foreach(println)
}
