{-# LANGUAGE BangPatterns #-}

import           Data.List (intersperse)
import           Data.Maybe (fromJust)
import           Control.Monad (foldM_)
import           Control.Applicative ((<$>))
import           Data.Vector.Unboxed (Vector, unsafeFreeze, (!))
import           Data.Vector.Unboxed.Mutable (IOVector, unsafeWrite, unsafeRead)
import qualified Data.Vector.Unboxed as V
import qualified Data.Vector.Unboxed.Mutable as MV
import qualified Data.ByteString.Char8 as BS

main :: IO ()
main   =   getLine
       >>  map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine
       >>= countingSort
       >>= putStrLn . unwords . map show

countingSort :: [Int] -> IO [Int]
countingSort !inputs
    =   MV.replicate 10001 0
    >>= \counts  -> foldM_ inc counts inputs
    >>  unsafeFreeze counts
    >>= \counts' -> return $ concatMap (\pos -> replicate (counts' ! pos) pos) [0..10000]
  where
    inc !cs !p =   unsafeRead  cs p
               >>= unsafeWrite cs p . (+1)
               >>  return cs

