object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt()
  val ab = List.fill(n)((sc.nextInt(), sc.nextInt()))
  val cd = List.fill(m)((sc.nextInt(), sc.nextInt()))
  for ((a, b) <- ab) {
    val ans = cd.map{ case (c, d) =>
      (a - c).abs + (b - d).abs
    }.zipWithIndex.min._2 + 1
    println(ans)
  }
}
