fun main(args: Array<String>) {
    codefestival2016qualac()
}

fun codefestival2016qualac() {
    val s = readLine()!!.toCharArray()
    val k = readLine()!!.toInt()

    var remainChange = k
    for (i in s.indices) {
        if (remainChange <= 0) break
        if (s[i] == 'a') continue
        val costToA = 'z' + 1 - s[i]
        if (remainChange >= costToA) {
            s[i] = 'a'
            remainChange -= costToA
        }
    }

    if (remainChange > 0) {
        s[s.lastIndex] = ((s.last() - 'a' + remainChange) % 26 + 'a'.toInt()).toChar()
    }

    val answer = s.joinToString("")

    println(answer)
}
