fun main() {
    val s = readLine() ?: return
    val k = readLine()?.toLong() ?: return
    var r = k
    buildString {
        s.forEach {
            val m = 26 - (it - 'a')
            if (m == 26) {
                append(it)
            } else if (r < m) {
                append(it)
            } else {
                r -= m
                append('a')
            }
        }
    }.let {
        if (r > 0) {
            val l = it.last()
            println(it.dropLast(1) + (l + r.toInt() % 26))
        } else {
            println(it)
        }
    }
}
