import Data.List
import qualified Data.Set as S

main = do
    s<-getLine::IO String
    let cs = foldl (flip S.delete) (S.fromList ['a'..'z']) s
    putStrLn $ if not $ null cs then s ++ [S.findMin cs] else sol cs $ reverse s
--
sol _ [_] = "-1"
sol cs (c:a:s)
    | a < cm = reverse $ cm:s
    | otherwise = sol cs' (a:s)
    where
        cs' = S.insert c cs
        cm = S.findMin cs'
