import Data.List

main = do
  li <-getLine
  let n = read li
  li <- getLine
  let as = map read $ words li
  let ans = compute n as
  mapM_ print ans

compute :: Int -> [Int] -> [Int]
compute n as = format [1..n] $ map (\as -> (head as, length as)) $ group $ sort as

format (k:ks) icics@((i,c):ics)
  | k == i = c : format ks ics
  | True   = 0 : format ks icics
format (k:ks) [] = 0 : format ks []
format _ _ = []