
fun main(arr:Array<String>) {
    val (n,m) = readLine()!!.split(" ").map { it.toInt() }
    val gakusei = (1..n).map { readLine()!!.split(" ").map { it.toLong() } }
    val checkooint = (1..m).map { readLine()!!.split(" ").map { it.toLong() } }

    val ans = gakusei.map { a-> checkooint.map { Math.abs(it[0]-a[0]) + Math.abs(it[1] - a[1]) }.let { b->b.indices.map { Pair(b[it], it) } }.sortedBy { it.first }.map { it.second + 1 }.first() }
    ans.forEach { println(it) }
}