#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  string s;cin>>s;
  ll i,j,k,n=s.size();cin>>k;
  for(i=0;i<n-1;i++){
    if(s[i]=='a') continue;
    if('z'-s[i]+1<=k){
      k-='z'-s[i]+1;
      s[i]='a';
    }
    if(k==0) break;
  }
  s[n-1]=(((s[n-1]-'a')+k)%26)+'a';
  cout << s << endl;
  return 0;
}
