import Control.Applicative
import Control.Monad
import Data.List
import Data.Ord (comparing)

f :: (Int, Int) -> (Int, Int) -> Int
f (a, b) (c, d) = abs (a - c) + abs (b - d)

g :: (Int, Int) -> [(Int, Int)] -> Int
g xs yss = fst . minimumBy (comparing snd) . zip [1..] $ fmap (f xs) yss

main :: IO ()
main = do
    [n, m] <- fmap read . words <$> getLine
    as <- replicateM n $ do
        [a, b] <- fmap read . words <$> getLine :: IO [Int]
        return (a, b)
    bs <- replicateM m $ do
        [a, b] <- fmap read . words <$> getLine :: IO [Int]
        return (a, b)
    let ans = fmap (flip g bs) as
    mapM_ print ans