import java.io.PrintWriter

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = nextList().map(String::toInt)
fun nextLongList() = nextList().map(String::toLong)
fun nextDoubleList() = nextList().map(String::toDouble)

val pw = PrintWriter(System.out)
fun print(s: Any = "") = pw.print(s)
fun println(s: Any = "") = pw.println(s)

fun <T> Iterable<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)
fun <T> Array<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)

fun main(args: Array<String>) {
    main()
    pw.flush()
}

fun main() {
    val (N, M) = nextIntList()
    val S = Array(N) {
        val (a, b) = nextLongList()
        P(a, b)
    }
    val C = Array(M) { i ->
        val (c, d) = nextLongList()
        Pair(i + 1, P(c, d))
    }
    for (s in S) {
        println(C.map { e -> Pair(e.first, s.manhattanTo(e.second)) }.minBy { it.second }!!.first)
    }
}

data class P(val x: Long, val y: Long) {
    fun manhattanTo(o: P) = Math.abs(x - o.x) + Math.abs(y - o.y)
}