import Control.Monad
dist a b c d = abs(a-c)+abs(b-d)

main = do
  [n,m] <- map read.words <$> getLine 
  ab <- replicateM n $ map read . words <$> getLine :: IO [[Int]]
  cd <- replicateM m $ map read . words <$> getLine :: IO [[Int]]
  mapM print.map snd.map minimum.(map (\[a,b]->map (\ ([c,d],i)->(dist a b c d,i)) $ zip cd [1..])) $ ab 
