import Control.Applicative( (<$>))
import Control.Monad( replicateM)
import Data.List( group, sort)

main = do
    let
	readLine = map read . words <$> getLine

    [n_, m_] <- readLine
    abs_ <- replicateM m_ readLine

    let
	ans = map length . group . sort $ concat abs_

    mapM_ print ans
