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()) }
    for (abP in ab) {
        println(cd.mapIndexed { idx, cdP -> Pair(dist(abP, cdP), idx + 1) }
            .minWith(compareBy({it.first}, {it.second}))!!.second)
    }
}

fun dist(a: Pair<Int, Int>, b: Pair<Int, Int>): Int {
    return Math.abs(a.first - b.first) + Math.abs(a.second - b.second)
}
