let s = read_line ()
let n = String.length s
let us = Array.make 26 false
let j = ref ~-1
let _ = Char.(String.(iteri (fun i c -> if i > 0 && s.[i - 1] < s.[i] then j := i - 1) s; iteri (fun i c -> if n < 26 || i <= !j then us.(code c - code 'a') <- true) s; if n = 26 && !j = -1 then (print_endline "-1"; exit 0); let m, t = if n < 26 then 0, s else code s.[!j] - code 'a' + 1, sub s 0 !j in for i = m to 25 do if not us.(i) then (Printf.printf "%s%c\n" t (chr (i + code 'a')); exit 0) done))