String.prototype.replaceAt=function(index, character) {
    return this.substr(0, index) + character + this.substr(index+character.length);
}

function Main(input) {
  input = input.split("\n");
  string = input[0];
  point = parseInt(input[1]);
  which = 0;
  while(point){
    if((27 - (string[which].charCodeAt(0) - 97 + 1)) <= point){
      point -= (27 - (string[which].charCodeAt(0) - 97 + 1));
      string = string.replaceAt(which, "a");
    }else{
      if (string.length === (which + 1)) {
        if(point == 0){
          break;
        }
        var code = (string[which].charCodeAt(0) + point);
        if(code > 122){
          code += (- 122 + 97 - 1);
        }
        var lastLetter = String.fromCharCode(code);
        string = string.replaceAt(which, lastLetter);
        point = 0;
      } else {
        which++;
      }
    }
  }
  console.log(string);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));