import Control.Applicative
import Control.Monad
import Data.Array.IO

main = do
        n <- readLn
        list <- map read.words<$>getLine
        arr <- newListArray (1,n) list
        b <- countingSort 10000 arr
        putStrLn.unwords.map show =<< getElems b

countingSort :: Int -> IOUArray Int Int -> IO (IOUArray Int Int)
countingSort k arr = do
        countArr <- newArray (0,k) 0 :: IO (IOUArray Int Int)
        countFreq countArr arr
        accumulateCount countArr
        writeElems countArr arr
        where
            countFreq :: IOUArray Int Int -> IOUArray Int Int -> IO ()
            countFreq ca a = do
                (s,g) <- getBounds a
                forM_ [s..g] $ \j -> readArray a j >>= \i -> modifyArray ca i (+1)
            accumulateCount ca = forM_ [1..k] $ \i -> do
                e' <- readArray ca (i-1)
                modifyArray ca i (+e')
            writeElems :: IOUArray Int Int -> IOUArray Int Int -> IO (IOUArray Int Int)
            writeElems ca a = do
                (s,g) <- getBounds a
                b <- newArray_ (s,g)
                forM_ [g,(g-1)..1] $ \j -> do
                    eA <- readArray a j
                    eC <- readArray ca eA
                    writeArray b eC eA
                    modifyArray ca eA (subtract 1)
                return b


modifyArray arr i f = do
        e <- readArray arr i
        writeArray arr i (f e)

