import Control.Monad
import Data.List
import Data.Maybe

main = do
    [n, m] <- map read . words <$> getLine
    ab <- map (map read. words) <$> replicateM n getLine :: IO [[Integer]]
    cd <- map (map read. words) <$> replicateM m getLine :: IO [[Integer]]
    let dists = map (map (\[[a, b], [c, d]] -> abs(a-c) + abs(b-d))) $  map (\x -> sequence [[x], cd]) ab
    let ans = map (\d -> 1 + fromMaybe (-1) (elemIndex (minimum d) d)) dists
    mapM_ print ans