import Data.List( foldl', sort, group)
import Control.Monad( replicateM)
import Data.Array.IArray
main = do
    [n,q] <- return . map read . words =<< getLine
    qs <- replicateM q readLn
    let start = [1..n]
	proc list sz = take sz $ cycle list
	rawAnswer = foldl' proc start qs
	sortedAns = group . sort $ rawAnswer
	arr::Array Int Int
	arr = accumArray (+) 0 (1,n) $ zipWith pack [1..] sortedAns 
		where
		    pack ix g = (ix, length g)
    mapM_ print $ elems arr