fun main(args: Array<String>) {
    val s = readInputLine().toCharArray()
    var K = readInputLine().toInt()
    
    for ((i, c) in s.withIndex()) {
        if (s[i] != 'a' && K >= ('z' - c) + 1) {
            s[i] = 'a'
            K -= ('z' - c) + 1
        }
    }
    
    s[s.size - 1] = (((s[s.size - 1] - 'a').toInt() + K) % ('z' - 'a' + 1).toInt() + 'a'.toInt()).toChar()

    println(s.joinToString(""))
}

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