import Control.Applicative
import Control.Monad
import Data.List

main = sol <$> getLine >>= putStrLn

sol s = if null t 
    then if null p then "-1" else init p ++ [head . sort $ tail q]
    else s ++ [head (sort t)]
    where
    t = ['a'..'z'] \\ s
    (p,q) = span (< 'z') s
