import qualified Data.ByteString.Char8 as BS
import Data.List
import Data.Maybe

readInt = fst . fromJust . BS.readInt

readIntList = map readInt . BS.words

getInt = readInt <$> BS.getLine

getIntList = readIntList <$> BS.getLine

simulate :: [Int] -> Int -> Bool
simulate [] _ = True
simulate (x : xs) i
  | x <= i = simulate xs (i + 1)
  | otherwise = False

main = do
  n <- getInt
  bs <- getIntList
  let bs' = sort bs
  if simulate bs' 1
    then mapM_ print (bs')
    else print (-1)
