local s = io.read()
if s == "zyxwvutsrqponmlkjihgfedcba" then
  print(-1)
elseif #s < 26 then
  for i = 1, 26 do
    local c = string.char(i + 96)
    if not s:find(c) then
      print(s .. c)
      break
    end
  end
else
  local found = false
  for pos = 25, 1, -1 do
    local left = pos == 1 and "" or s:sub(1, pos - 1)
    local cur = s:sub(pos, pos)
    local cur_i = string.byte(cur) - 96
    for i = cur_i + 1, 26 do
      local c = string.char(i + 96)
      if not left:find(c) then
        print(left .. c)
        found = true
        break
      end
    end
    if found then break end
  end
end
