import qualified Data.Vector as V
import           Data.List
import           Control.Applicative
import           Control.Monad

main :: IO ()
main = do
  n <- getLine
  bs <- map read . words <$> getLine
  let x = solve bs 1
  if (-1) `elem` x
    then putStrLn "-1"
    else mapM_ print x

solve [] _ = []
solve (b:bs) n
  | 1 <= b && b <= n = b:solve bs (n + 1)
  | otherwise = [-1]

