#include <bits/stdc++.h>
using namespace std;

int main(){
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(0);
	string s;
	int k;
	cin >> s >> k;
	for(int i = 0;i < s.length(); ++i){
		int move = ('z' + 1 - s[i]) % 26;
		if(k >= move){
			k-=move;
			s[i] = 'a';
		}
	}
	int nd = s.length() - 1;
	k %= 26;
	s[nd] = 'a' + (s[nd] - 'a' + k) % 26;
	cout << s << '\n';
}
