import Control.Monad
import Control.Applicative
import Data.List
import qualified Data.Map as Map
import Data.Array
import qualified Data.ByteString.Char8 as BC
import Data.Maybe
import qualified Data.Set as Set
import qualified Data.Sequence as Sq
import qualified Data.IntMap as IMap
import Data.Sequence (ViewL(..),ViewR(..),(><),(<|),(|>),Seq)

bsreadInt :: BC.ByteString -> Int
bsreadInt = fst . fromJust . BC.readInt

d :: [Int] -> [Int] -> Int
d an cn = (abs (a-c)) + (abs (b-d))
        where a = an !! 0
              b = an !! 1
              c = cn !! 0
              d = cn !! 1
              
mapd an cns = [d an cn | cn <- cns]

solve [] a n m = m+1
solve (s:sn) a n m = if s < a
                     then solve sn s (n+1) n
                     else solve sn a (n+1) m
main = do
    [n,m] <- map bsreadInt . BC.words <$> BC.getLine
    ab <- map ((map bsreadInt . BC.words)) <$> replicateM n BC.getLine
    cd <- map ((map bsreadInt . BC.words)) <$> replicateM m BC.getLine
    
    let ans = [solve (mapd (ab!!i) cd) 20000003 0 0 | i <- [0..n-1]]
    mapM_ print ans