import java.util.Scanner

object Main extends App  {
  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val m = sc.nextInt

  val xs = List.fill(n)((sc.nextInt, sc.nextInt))
  val cs = List.fill(n)((sc.nextInt, sc.nextInt))

  val resl = xs.map(xP => cs.map(distance(xP, _)).zipWithIndex.min._2 + 1)

  resl.foreach(println)

  def distance(aPair: (Int,Int), xPair:(Int,Int)) : Long ={
    Math.abs(aPair._1 - xPair._1)  + Math.abs(aPair._2 - xPair._2)
  }
}
