#include <iostream>
using namespace std;

int main() {
int n,k;
string s;
cin>>s>>k;
n=s.length();
for(int i=0;i<n-1;i++){
    //cout<<s[i]-'a'<<endl;
    int d=26-s[i]+'a';
    if(d<26&&d<=k){
        k-=d;
        s[i]='a';
    }
}
s[n-1]=(s[n-1]-'a'+k)%26+'a';
cout<<s<<endl;
	return 0;
}