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

    var cnt = 0

    for (i in s.indices) {
        val d = ('z' - s[i] + 1) % 26
        if (d <= k - cnt) {
            s[i] = 'a'
            cnt += d
        }
    }

    if (k - cnt > 0) {
        s[s.lastIndex] = s[s.lastIndex] + ((k - cnt) % 26)
    }

    println(s.joinToString(""))
}
