import Foundation
func toTuple<T>(_ args: [T]) -> (T, T) { (args[0], args[1]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

let (n, m) = toTuple(readInts())
var aibi: [(Int, Int)] = []
var cidi: [(Int, Int)] = []
for _ in 0..<n {
  aibi.append(toTuple(readInts()))
}
for _ in 0..<m {
  cidi.append(toTuple(readInts()))
}
for ab in aibi {
  var di: [Int] = []
  for cd in cidi {
    di.append(abs(ab.0 - cd.0) + abs(ab.1 - cd.1))
  }
  print(di.firstIndex(of: di.min()!)! + 1)
}