import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val m = scanner.nextInt()
    val nList = mutableListOf<Pair<Int,Int>>()
    val mList = mutableListOf<Pair<Int,Int>>()
    for (i in 0 until n) nList.add(Pair(scanner.nextInt(),scanner.nextInt()))
    for (i in 0 until m) mList.add(Pair(scanner.nextInt(),scanner.nextInt()))
    val resultList= mutableListOf<Int>()

    nList.forEach {spos ->
        var distlist = mutableListOf<Int>()
        mList.forEach {cpos ->
            val dist = Math.abs((spos.first - cpos.first)) + Math.abs((spos.second - cpos.second))
            distlist.add(dist)
        }
        resultList.add(distlist.indexOf(distlist.min())+1)
    }
    resultList.forEach {
        println(it)
    }
}