let () =
  let s = read_line () in
  print_endline @@
  if s = "zyxwvutsrqponmlkjihgfedcba" then "-1"
  else if String.length s = 26 then
    Array.init 25 (fun i -> i)
    |> Array.to_list
    |> List.rev
    |> List.find (fun i ->
        s.[i] <> 'z' &&
        Array.init i (fun j -> Char.code s.[j])
        |> Array.to_list
        |> List.for_all (( <> ) (Char.code s.[i] + 1)))
    |> (fun i -> String.sub s 0 i ^ String.make 1 (Char.chr (1 + Char.code s.[i])))
  else "hoge"
    (* 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
    |> ( ^ ) s *)