#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <map>
#include <stack>
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
const int MaxN = 1e5 + 4;
typedef long long LL;
typedef pair<int,int> PLL;
string s;
int vis[300];
int main(){
	int k;
	cin>>s;
	cin>>k;
	for(int i = 0; i < s.size(); i++){
		vis[i] = 'z'-s[i]+1;
	}
	for(int i = 0; i < s.size(); i++){
		if(k - vis[i] >= 0){
			k -= vis[i];
			vis[i] = 0;
			s[i] = 'a';
		}
	}
	for(int i = s.size(); i >= 0; i--){
		if(k == 0) break;
		if(vis[i] > k){ s[i]+= k; k = 0;}
	}
	cout<<s<<endl;
	return 0;
}