import java.lang.Math.abs
import java.util.*

val sc = Scanner(System.`in`)
val N = sc.nextInt()
val M = sc.nextInt()

fun main(args: Array<String>) {
    val ab = Array(N) { Pair(0, 0) }
    val cd = Array(M) { Pair(0, 0) }

    for (i in 0 until N) {
        ab[i] = Pair(sc.nextInt(), sc.nextInt())
    }

    for (j in 0 until M) {
        cd[j] = Pair(sc.nextInt(), sc.nextInt())
    }

    for (i in 0 until N) {
        var k = 0
        var v = Int.MAX_VALUE
        for (j in 0 until M) {
            val a = ab[i].first
            val b = ab[i].second
            val c = cd[j].first
            val d = cd[j].second

            val t = abs(a - c) + abs(b - d)
            if (t < v) {
                v = t
                k = j + 1
            }
        }
        println(k)
    }
}
