import Control.Monad

main = do
    [n, m] <- map read . words <$> getLine
    ab <- map (map read. words) <$> replicateM n getLine
    cd <- map (map read. words) <$> replicateM m getLine
    mapM_ print $ [minIdx [mht xab xcd | xcd <- cd] | xab <- ab]

mht [a, b] [c, d] = abs(a - c) + abs(b - d)
minIdx as = snd $ minimum $ zip as [1..]