data class Point(val x: Int, val y: Int)

fun distance(a: Point, b: Point) = Math.abs(a.x - b.x) + Math.abs(a.y - b.y)

fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(' ').map(String::toInt)
    val st = Array(n) {
        val (a, b) = readLine()!!.split(' ').map(String::toInt)
        Point(a, b)
    }
    val cp = Array(m) {
        val (c, d) = readLine()!!.split(' ').map(String::toInt)
        Point(c, d)
    }
    for (s in st) {
        var nearestDst = Int.MAX_VALUE
        var nearestIdx = -1
        for ((i, c) in cp.withIndex()) {
            val d = distance(s, c)
            if (d < nearestDst) {
                nearestDst = d
                nearestIdx = i
                if (d == 0) break
            }
        }
        println(nearestIdx + 1)
    }
}
