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 [] (a:as) =  (str ++ [a])
next str [] [] = next' [] $ reverse str 
next str (c:cs) alpha = next str cs $ delete c alpha  

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