object Main {
  def main(args: Array[String]): Unit = {
    val str = io.StdIn.readLine()
    var k = io.StdIn.readLine().toLong

    val newStr = for (i <- 0 to (str.length - 2)) yield {
      val d = 'z' + 1 - str(i)
      if (d <= k) { k = k - d; 'a' }
      else str(i)
    }

    val lastChar = {
      val c = str.last + (k % 26)
      if (c > 'z') c - 26
      else         c
    }

    val ans = newStr.mkString + lastChar.toChar
    println(ans)
  }
}

