import Data.List
main=do
 n<-readLn
 k<-sort.map read.words<$>getLine
 putStr$unlines$map show$f 1 n 0 k
f i n c[]
 |i>n=[]
 |otherwise=c:f(i+1)n 0[]
f i n c(k:ks)
 |i>n=[]
 |i==k=f i n(c+1)ks
 |otherwise=c:f(i+1)n 0(k:ks)