import java.lang.Math.abs

fun main(args: Array<String>) {
    abc057b()
}

private data class Coordinate(val x: Long, val y: Long)

fun abc057b() {
    val (n, m) = readLine()!!.split(" ").map { it.toInt() }
    val students = (1..n).map { readLine()!!.split(" ").map { it.toInt() } }
        .map { Coordinate(it[0].toLong(), it[1].toLong()) }
    val flags = (1..m).map { readLine()!!.split(" ").map { it.toInt() } }
        .map { Coordinate(it[0].toLong(), it[1].toLong()) }

    val answer = students.map { student ->
        // index, coordinate
        var nearestFlagOfStudent = Pair(1, flags.first())
        flags.forEachIndexed { index, flag ->
            val diff = abs(student.x - flag.x) + abs(student.y - flag.y)
            val cnf = nearestFlagOfStudent.second
            val cnfDiff = abs(student.x - cnf.x) + abs(student.y - cnf.y)
            if (diff < cnfDiff) nearestFlagOfStudent = Pair(index + 1, flag)
        }
        nearestFlagOfStudent.first
    }.joinToString(System.lineSeparator())

    println(answer)
}
