import Data.List

alpha = ['a'..'z']

next' c (x:xx:xs)
  | x<xx = next' (x:c) (xx:xs)
  | x>xx = reverse xs ++ [minimum c]

next :: String -> String -> String -> String

next str [] [] = next' [] $ reverse str 
next str [] alpha = str ++ [head alpha]
next str cs alpha = next str (tail cs) $ delete (head cs) alpha

main = do
  str <- getLine
  if nub str == str
    then putStrLn $ next str str alpha
    else print $ -1
    