main = do
    s <- getLine
    let alphabet = "abcdefghijklmnopqrstuvwxyz"
        n = length s
        ans | n < 26 = s ++ g s alphabet
            | null s' = "-1"
            | otherwise = init s' ++ g s' (dropWhile (<= last s') alphabet)
            where s' = take (n - f (reverse s)) s
    putStrLn ans

f [] = 0
f (a:[]) = 1
f (a:b:as) | a < b = 1 + f (b:as)
           | otherwise = 1

g s a = head (dropWhile (`elem` s) a) : []