fun main(args: Array<String>){
    val s = readLine()!!
    val contain = mutableSetOf<Char>()
    s.forEach {
        contain.add(it)
    }

    for (c in 'a' until 'z' + 1) {
        if (c !in contain) {
            println(s.plus(c))
            return
        }
    }

    val sRev = s.reversed()
    val removed = mutableSetOf<Char>()
    sRev.forEachIndexed {
        i, it ->
            for (c in it + 1 until 'z' + 1) {
                if (c in removed) {
                    println((c.plus(sRev.slice(i + 1 until sRev.length)).reversed()))
                    return
                }
            }
            removed.add(it)
    }
    println(-1)
}
