import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.Array.Unboxed
import Data.Bits
import Data.List
import qualified  Data.ByteString as B
import Data.Ord


bsToInt :: BS.ByteString -> Int
bsToInt = fst . fromJust . BS.readInt

bsToIntList :: BS.ByteString -> [Int]
bsToIntList = map bsToInt . BS.words

count :: Int -> [Int] -> (Int, [Int])
count _ [] = (0, [])
count k (a:as) 
    | k==a = (1 + cn ,rs)
    | otherwise = (0, (a:as))
    where
        (cn, rs) = count k as

subs' :: Int -> [Int] -> [Int]
subs' 0 _ = []
subs' n as = cn : subs' (n-1) rs
    where
        (cn, rs) = count n as

main :: IO ()
main = do 
    n <- bsToInt <$> BS.getLine
    as <- bsToIntList <$> BS.getLine
    let rev = sortOn Data.Ord.Down as
    mapM_ print (reverse (subs' n rev))
