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