import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val m = scanner.nextInt()
    val user = (1..n).map {
        Pair(scanner.nextInt(),scanner.nextInt())
    }.toMutableList()
    val point = (1..m).map {
        Pair(scanner.nextInt(),scanner.nextInt())
    }.toMutableList()
    
    user.forEach { spos ->
        var distlist = 
        point.map { cpos -> 
            Math.abs((spos.first - cpos.first)) + Math.abs((spos.second - cpos.second))
        }.toList()
        println(distlist.indexOf(distlist.min())+1)
    }
   
}
