import Control.Monad
f [a,b] [c,d] = abs (a-c) + abs (b-d)
main = do
  [n,m] <- map read . words <$> getLine
  abs <- replicateM n $ map read . words <$> getLine
  cds <- replicateM m $ map read . words <$> getLine
  mapM (\ab -> print $ snd $ minimum $ zip (map (f ab) cds) [1..]) abs