#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(i+1<s.size()){
	        if('z'-s[i]<K && s[i]!='a'){
	            K -= ('z'-s[i])+1;
	            s[i]='a';
	        }
	    }
	    else s[i]='a'+(s[i]-'a'+K)%26;
	}
	cout << s << endl;
	return 0;
}
