'use strict';
function Main(is) {
  const i = is.split("\n");
  let s = i[0];
  let p = parseInt(i[1]);
  for(let i = 0;i < s.length;i++){
    let code = s[i].charCodeAt(0);
    if (s.length - 1 == i) {
      code += p%26;
      if(code > 122){
        code += (- 122 + 97 - 1);
      }
      let lastLetter = String.fromCharCode(code);
      s = s.slice(0, i) + lastLetter + s.slice(i+1);
    } else {
      if((27 - (code - 97 + 1)) <= p && !(s[i] == "a")){
        p = p - (27 - (code - 97 + 1));
        s = s.slice(0, i) + "a" + s.slice(i+1);
      }
    }
  }
  console.log(s);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));