import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)

main :: IO ()
main = do
    [n, m] <- readInts
    xs <- replicateM n $ do
        [a, b] <- readInts
        return (a, b)
    ys <- replicateM m $ do
        [c, d] <- readInts
        return (c, d)
    forM_ [0..(n - 1)] $ \i -> do
        ts <- forM [0..(m - 1)] $ \j -> return $ man (fst (xs !! i)) (fst (ys !! j)) (snd (xs !! i)) (snd (ys !! j))
        print $ minIndex ts + 1
    where
        readInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine :: IO [Int]
        man x1 x2 y1 y2 = abs (x1 - x2) + abs (y1 - y2)
        minIndex ss = head $ filter ((== minimum ss) . (ss !!)) [0..]
