import java.util.*

fun main(args: Array<String>) {
  
    val scanner = Scanner(System.`in`)
    val N = scanner.nextLong()
    val M = scanner.nextLong()
    val parsonPositionList = (1..N).map { Pair(scanner.nextLong(), scanner.nextLong()) }.toList()
    val checkPointList = (1..M).map { Pair(scanner.nextLong(), scanner.nextLong()) }.toList()
    for (personPosition in parsonPositionList) {
        var minValue = Long.MAX_VALUE
        var minNum = 0
        checkPointList.forEachIndexed { index, checkPoint ->
            val abs = Math.abs(checkPoint.first - personPosition.first) + Math.abs(checkPoint.second - personPosition.second)
            if (minValue > abs) {
                minValue = abs
                minNum = index + 1
            }
        }
        println(minNum)
    }
}