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 a = Array(N) { 0 }
    val b = Array(N) { 0 }
    val c = Array(M) { 0 }
    val d = Array(M) { 0 }

    for (i in 0 until N) {
        a[i] = sc.nextInt()
        b[i] = sc.nextInt()
    }

    for (j in 0 until M) {
        c[j] = sc.nextInt()
        d[j] = sc.nextInt()
    }

    for (i in 0 until N) {
        var key = 0
        var valu = Int.MAX_VALUE
        for (j in 0 until M) {
            val tmp = abs(a[i] - c[j]) + abs(b[i] - d[j])
            if (tmp < valu) {
                valu = tmp
                key = j + 1
            }
        }
        println(key)
    }
}
