import Control.Monad
import Data.List

solve :: [(Int, Int)] -> [(Int, (Int, Int))] -> [Int]
solve [] _ = []
solve (ab:abs) cds = (fst . head . sortOn snd $ map (calc ab) cds) : solve abs cds

calc :: (Int, Int) -> (Int, (Int, Int)) -> (Int, Int)
calc (a, b) (i, (c, d)) = (i, dx + dy)
  where dx = abs $ a - c
        dy = abs $ b - d

main :: IO ()
main = do
  [n, m] <- map read . words <$> getLine
  let toPair [x, y] = (x, y)
  abs <- replicateM n $ toPair . map read . words <$> getLine
  cds <- replicateM m $ toPair . map read . words <$> getLine
  mapM_ print $ solve abs $ zip [1..] cds