import Control.Monad
import Data.List

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

search cds [a,b] = snd $ minimum $ map (\(i,[c,d])-> (abs (a-c) + abs (b-d), i)) cds
