
fun main(args:Array<String>) {
    val s = readLine()!!.toMutableList()

    if(s.size == s.distinct().size) {
        if(s.size < 26) {
            for(i in ('a'..'z')) {
                if(s.contains(i)) {
                    continue
                }
                s.add(i)
                println(s.joinToString(""))
                return
            }
        }
    }
    println(getAns(s))
}

fun getAns(target:MutableList<Char>): String {
    for(i in (0 .. target.lastIndex).reversed()) {
        if(target[i] == 'z') {
            continue
        }
        if(i == 0) {
            val tmp = ('a'..'z').toList()
            var idx = tmp.indexOf(target[0])
            return tmp[idx+1].toString()
        }
        val sub = target.subList(0, i)
        if(sub.size != sub.distinct().size) {
            continue
        }
        for(j in (target[i]..'z')) {
            if(j == target[i]) {
                continue
            }
            if(sub.contains(j)) {
                continue
            }
            sub.add(j)
            return sub.joinToString("")
        }
    }
    return "-1"
}
