import Data.List
import qualified Data.Map.Strict as M

main = do
    [n,_] <- map read . words <$> getLine
    m <- M.fromDistinctAscList . map (\xs -> (head xs, length xs)) . group . sort . map read . words <$> getContents
    let rs = map (\x -> M.findWithDefault 0 x m) [1..n]
    mapM_ print rs
