#include <iostream>
#include <string>

int main() {
  std::string s;
  std::cin >> s;
  uint64_t k;
  std::cin >> k;
  for (int i = 0; i < (int)s.size(); ++i) {
    if (k == 0) {
      break;
    }
    if (s[i] + k >'z' && s[i] != 'a') {
      k -= 'z' - s[i] + 1;
      s[i] = 'a';
    }
  }
  s[s.size()-1] += k % 26;
  std::cout << s << std::endl;
}
