import java.lang.StringBuilder

fun main(args:Array<String>) {
    val (n,m) = readLine()!!.split(" ").map { it.toInt() }
    val gakuseiList = (1..n).map { Pos(readLine()!!) }
    val checkPointList = (1..m).map { Pos(readLine()!!) }
    val ans = StringBuilder()
    for(i in gakuseiList) {
        var min = Long.MAX_VALUE
        var minIdx = Int.MAX_VALUE
        for(j in checkPointList.indices.reversed()) {
            if(min >= i.getDiff(checkPointList[j])) {
                min = i.getDiff(checkPointList[j])
                minIdx = j
            }
        }
        ans.appendln(minIdx + 1)
    }
    print(ans.toString())
}

class Pos(input:String) {
    val x = input.split(" ").map { it.toLong() }[0]
    val y = input.split(" ").map { it.toLong() }[1]
    fun getDiff(target:Pos):Long {
        return Math.abs(x-target.x) + Math.abs(y-target.y)
    }
}
