#include <iostream>
#include <string>
using namespace std;

int main()
{
  string s;
  int k;
  cin >> s >> k;

  for(int i = 0; i < s.size(); i++){
    if(s[i] == 'a') continue;
    int x = 'z'-s[i]+1;
    if(k >= x){
      k -= x;
      s[i] = 'a';
    }
  }

  if(k){
    s[s.size()-1] = 'a' + (s[s.size()-1] - 'a' + k) % 26;
  }

  cout << s << endl;

  return 0;
}
