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