let succ s =
  Array.init 26 (fun i -> Char.chr (Char.code 'a' + i))
  |> Array.to_list
  |> List.find (fun c ->
      Array.init (String.length s) (fun i -> s.[i])
      |> Array.to_list
      |> List.for_all (( <> ) c))
  |> String.make 1

let rec solve s i =
  if s.[i - 1] < s.[i] then i
  else solve s (i - 1)

let () =
  let s = read_line () in
  print_endline @@
  if s = "zyxwvutsrqponmlkjihgfedcba" then "-1"
  else if String.length s = 26 then
    solve s 25
    |> (fun n -> String.sub s 0 (n - 1) ^ succ (String.sub s 0 n))
  else s ^ succ s