let s = read_line ()
let n, fs, is, i = Array.(String.length s, make 26 false, make 26 0, ref 0)
let f s n = Printf.printf "%s%c\n" s (Char.chr (n + 97)); exit 0
let _ = String.(Char.(iter (fun c -> let n = code c - 97 in fs.(n) <- true; is.(!i) <- n; incr i) s;
  if n < 26 then (i := 0; while fs.(!i) do incr i done; f s !i);
  for j = n - 1 downto 0 do i := code s.[j] - 96; while !i < 26 && fs.(!i) do incr i done; if !i < 26 then f (sub s 0 j) !i; fs.(is.(j)) <- false done; print_endline "-1"))