

import scala.io.StdIn

object Main {
  def main(args: Array[String]): Unit = {
    val str = StdIn.readLine()
    val K = StdIn.readInt()
    var counter = K
    var ans = ""
    for (c <- str.toCharArray) {
      if (c == 'a')
        ans += c
      else {
        val num = c - 'a'
        val changeNum = 26 - num
        if (counter >= changeNum) {
          counter -= changeNum
          ans += 'a'
        } else {
          ans += c
        }
      }
    }
    val lastChar = ans.charAt(ans.length -1) + counter % 26
    val printChar = if (lastChar > 'z') 'a'.toInt + lastChar - 'z'.toInt else lastChar
    println(ans.substring(0, ans.length - 1) + printChar.toChar)
  }
}
