import Data.List
import Data.Maybe
import Control.Monad
import qualified Data.ByteString.Char8 as C

readInt' = fst.fromJust.C.readInt
readLnInt = map readInt'.C.words<$>C.getLine
readCsInt n = concat<$>replicateM n readLnInt

x ? (a,b) = if x then a else b
a~>(f,x) = [a] ++ (null x)?([],f x)
half = flip div 2
aliq = ((0==).).mod

main = do
 [n] <- readLnInt
 inputs <- readLnInt
 putStr.unlines.map show $ solve n inputs

solve n as = calc n 1 (group(sort as))


calc n t []
 | t > n = []
 | otherwise = [0] ++ calc n (t+1) []
calc n t as@(ai:ajs)
 | t > n = []
 | otherwise = [(t==a)?(length ai,0)] ++ calc n (t+1) ((t==a)?(as,ajs)) where
    a = head ai
