import java.io.PrintWriter
import kotlin.math.min

fun main(args: Array<String>) {
    PrintWriter(System.out).use { out ->
        solve(out)
        out.flush()
    }
}

data class Point(val x: Int, val y: Int) {
    fun distanceTo(p: Point) = Math.abs(p.x - this.x) + Math.abs(p.y - this.y)
}

fun solve(out: PrintWriter) {
    val (n, m) = readIntegerList()
    val manArray = Array(n) {
        val (a, b) = readIntegerList()
        Point(a, b)
    }
    val cArray = Array(m) {
        val (c, d) = readIntegerList()
        Point(c, d)
    }

    for (man in manArray) {
        var ans = 1
        var minDistance = man.distanceTo(cArray[0])
        for ((i, c) in cArray.withIndex()) {
            val tmp = man.distanceTo(c)
            if (tmp < minDistance) {
                minDistance = tmp
                ans = i + 1
            }
        }
        out.println(ans)
    }
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
fun readDoubleList() = readStringList().map(String::toDouble)
