
import Debug.Trace
import Data.Array
import Data.List

get :: IO (Int, Array Int Int)
get = do
  n <- read <$> getLine
  ary <- (listArray (1,n) . map read . words) <$> getLine
  pure (n, ary)

solve :: Int -> Array Int Int -> Array Int Int
solve n as = solve' as (listArray (bounds as) $ repeat 0)
  where
    maximum' as = foldl1 (\(i,x) (j,y) -> if x > y then (i,x) else (j,y)) $ assocs as
    minimum' as = foldl1 f $ assocs as
      where
        f (i,x) (j,y)
          | x <= 0 = (j,y)
          | y <= 0 = (i,x)
          | x > y = (j,y)
          | otherwise = (i,x)

    solve' as cs =
      if x > 0 then
        solve' (as // [(j, y - 1)]) (cs // [(i, (cs ! i) + 1)])
      else
        cs
      where
        (i,x) = maximum' as
        (j,y) = minimum' as

main = do
  as <- uncurry solve <$> get
  mapM_ print as 
