#include <iostream>
#include <string>
using namespace std;
int main(void){
  int k,n,i=0;
  string s;
  cin >> s >> k;
  n=s.size();
  while (k>0 && i<n){
    if (s[i]=='a' || k<'z'+1-s[i]){
      i++;
      continue;
    }
    k-='z'-s[i]+1;
    s[i]='a';
    i++;
  }
  if (k>0) s[n-1]+=k%26;
  cout << s << endl;
  return 0;
}