fun main(args: Array<String>) {
    val S = readInputLine()

    if (S == "zyxwvutsrqponmlkjihgfedcba") {
        println(-1)
        return
    }

    val used = BooleanArray(26)

    S.forEach { used[it - 'a'] = true }

    if (S.length != 26) {
        for (i in 0 until 26) {
            if (!used[i]) {
                println(S + ('a' + i).toString())
                return
            }
        }
    } else {
        val Sarr = S.toCharArray()

        for (i in 26 - 1 downTo 0) {
            for (j in Sarr[i] + 1..'z') {
                if (!used[j - 'a']) {
                    Sarr[i] = j
                    for (k in 0..i) {
                        print(Sarr[k])
                    }
                    println()
                    return
                }
            }
            used[Sarr[i] - 'a'] = false
        }
    }
}

fun readInputLine(): String {
    return readLine()!!
}
