#include <iostream>
#include <string>

using namespace std;
int main(){
	string s;
	cin >> s;
	int i,k,a[100010];
	cin >> k;
	for(i=0;i<s.size();i++){
		a[i] = ('z'- s[i] + 1)%26;
	}
	
	for(i=0;i<s.size()-1;i++){
		if(k>=a[i]){
			k -= a[i];
			s[i] = 'a';
		}
	}
	if(k>0){
		s[s.size()-1] = (k%26 + s[s.size()-1] - 'a')%26 + 'a';
	}
	cout << s << endl;
}