#include "iostream"
#include "string"
#include "vector"
using namespace std;

int main(void) {
  string s;
  int K;
  cin >> s >> K;
  string ans = "";

  for (int i = 0; i < s.length() - 1; i++) {
    if ('z' - s[i] + 1 <= K) {
      ans += 'a';
      K -= 'z' - s[i] + 1;
    }
    else {
      ans += s[i];
    }
  }

  char c = s[s.length() - 1];
  for (int i = 0; i < K % 26; i++) {
    if (c == 'z') {
      c = 'a';
    }
    else {
      c = (c + 1);
    }
  }

  cout << ans + c << endl;
}
