import Control.Monad import qualified Data.ByteString.Char8 as B import Data.Maybe rInt :: B.ByteString -> Int rInt = fst . fromJust . B.readInt rank k [] = [] rank k (a:as) = k' : rank k' as where k' | a > k = k + 1 | otherwise = k main = do n <- readLn as <- map rInt <$> replicateM n B.getLine mapM_ print (rank (head as) as)