import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val m = sc.nextInt()
  val ab = (1..n).map { Pair(sc.nextInt(), sc.nextInt()) }
  val cd = (1..m).map { Pair(sc.nextInt(), sc.nextInt()) }

  val array = IntArray(n) { 0 }

  for (i in 0 until n) {
    val a = ab[i].first
    val b = ab[i].second
    var min = Int.MAX_VALUE
    var tmpj = 0
    for (j in 0 until m) {
      val c = cd[j].first
      val d = cd[j].second
      val dist = Math.abs(a - c) + Math.abs(b - d)
      if (dist < min) {
        tmpj = j
        min = dist
      }
    }
    array[i] = tmpj + 1
  }


  println(array.joinToString("\n"))

}
