import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n, m = sc.nextInt()

    val students = new Array[(Int, Int)](n)
    val points = new Array[(Int, Int)](m)

    for (i <- 0 until n) {
      val a, b = sc.nextInt()
      students(i) = (a, b)
    }

    for (i <- 0 until m) {
      val c, d = sc.nextInt()
      points(i) = (c, d)
    }

    for (i <- students.indices) {
      var ans = 0
      var distance = Long.MaxValue
      val (a, b) = students(i)

      for (j <- m - 1 to 0 by -1) {
        val (c, d) = points(j)
        if (distance >= (math.abs(a - c) + math.abs(b - d))) {
          ans = j
          distance = math.abs(a - c) + math.abs(b - d)
        }
      }

      println(ans + 1)
    }
  }
}