object Bc05701 extends App {

	def m(x1: Int, y1: Int, x2: Int, y2: Int): Int = {
		(x1 - x2).abs + (y1 - y2).abs
	}

	var s = readLine

	val N = s.split(" ")(0).toInt
	val M = s.split(" ")(1).toInt

	val Nx: Array[Int] = new Array(N)
	val Ny: Array[Int] = new Array(N)

	val Mx: Array[Int] = new Array(M)
	val My: Array[Int] = new Array(M)

	val Ans: Array[Int] = new Array(N)

	for(i <- 0 until N){
		var s = readLine
		Nx(i) = s.split(" ")(0).toInt
		Ny(i) = s.split(" ")(1).toInt
	}

	for(i <- 0 until M){
		var s = readLine
		Mx(i) = s.split(" ")(0).toInt
		My(i) = s.split(" ")(1).toInt
	}

	for(i <- 0 until N){
		var t = m(Nx(i), Ny(i), Mx(0), My(0))
		var ans = 0
		for(j <- 1 until M){
			val z = m(Nx(i), Ny(i), Mx(j), My(j)) 
			if(t > z){
				t = z
				ans = j
			}
		}
		Ans(i) = ans + 1;
	}

	for(i <- 0 until N){
		println(Ans(i))
	}

}