import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = println {
    val sc = new Scanner(System.in)
    val (n, m) = (sc.nextInt(), sc.nextInt())
    val studentXs, studentYs = Array.fill(n)(0)
    val checkpointXs, checkpointYs = Array.fill(m)(0)
    for (i <- 0 until n) {
      studentXs(i) = sc.nextInt()
      studentYs(i) = sc.nextInt()
    }
    for (i <- 0 until n) {
      checkpointXs(i) = sc.nextInt()
      checkpointYs(i) = sc.nextInt()
    }
    solve(n, m, studentXs, studentYs, checkpointXs, checkpointYs)
  }

  def solve(n: Int, m: Int,
            studentXs: Array[Int], studentYs: Array[Int],
            checkpointXs: Array[Int], checkpointYs: Array[Int]): String = {
    val results = Array.fill(n)(0)
    for (i <- 0 until n) {
      val (x1, y1) = (studentXs(i), studentYs(i))
      var (result, longestDist) = (0, Int.MaxValue)
      for (j <- 0 until m) {
        val (x2, y2) = (checkpointXs(j), checkpointYs(j))
        val d = math.abs(x1 - x2) + math.abs(y1 - y2)
        if (d < longestDist) {
          result = j
          longestDist = d
        }
      }
      results(i) = result + 1
    }
    results.mkString("\n")
  }
}
