import std.stdio,
       std.string,
       std.conv;

void main() {
  char[] s = readln.chomp.to!(char[]);
  int K = readln.chomp.to!(int);
  char[] ans;
  foreach (char c; s[0..(s.length - 1)]) {
    if ('z' - c.to!(char) + 1 <= K) {
      ans ~= 'a';
      K -= c - 'a';
    }
    else {
      ans ~= c;
    }
  }
  char c = s[s.length - 1];
  for (int i = 0; i < K % 26; i++) {
    if (c == 'z') {
      c = 'a';
    }
    else {
      c = (c + 1).to!(char);
    }
  }
  writeln(ans ~ c);
}
