object Main {
  def ctoi(c: Char): Int = c match {
    case 'a' =>  1
    case 'b' =>  2
    case 'c' =>  3
    case 'd' =>  4
    case 'e' =>  5
    case 'f' =>  6
    case 'g' =>  7
    case 'h' =>  8
    case 'i' =>  9
    case 'j' => 10
    case 'k' => 11
    case 'l' => 12
    case 'm' => 13
    case 'n' => 14
    case 'o' => 15
    case 'p' => 16
    case 'q' => 17
    case 'r' => 18
    case 's' => 19
    case 't' => 20
    case 'u' => 21
    case 'v' => 22
    case 'w' => 23
    case 'x' => 24
    case 'y' => 25
    case 'z' => 26
  }

  def itoc(i: Int): Char = i match {
    case  1 => 'a'
    case  2 => 'b'
    case  3 => 'c'
    case  4 => 'd'
    case  5 => 'e'
    case  6 => 'f'
    case  7 => 'g'
    case  8 => 'h'
    case  9 => 'i'
    case 10 => 'j'
    case 11 => 'k'
    case 12 => 'l'
    case 13 => 'm'
    case 14 => 'n'
    case 15 => 'o'
    case 16 => 'p'
    case 17 => 'q'
    case 18 => 'r'
    case 19 => 's'
    case 20 => 't'
    case 21 => 'u'
    case 22 => 'v'
    case 23 => 'w'
    case 24 => 'x'
    case 25 => 'y'
    case 26 => 'z'
  }

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

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

    println((newStr.slice(0, newStr.length - 1).mkString + itoc(ctoi(newStr(str.length - 1)) + k)))
  }
}

