import java.util.*

fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

object Problem {
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val N = sc.next().toInt()
        val M = sc.next().toInt()
        val AB = Array(N) { Pair(sc.next().toLong(), sc.next().toLong()) }
        val CD = Array(M) { Pair(sc.next().toLong(), sc.next().toLong()) }

        AB.forEach { ab ->
            val a = ab.first
            val b = ab.second
            var min = Long.MAX_VALUE
            var ans = -1
            for (j in CD.indices) {
                val c = CD[j].first
                val d = CD[j].second
                val distance = Math.abs(a - c) + Math.abs(b - d)
                if (min > distance) {
                    min = distance
                    ans = j
                }
            }
            pw.println(ans + 1)
        }
    }
}
