#include<bits/stdc++.h>
using namespace std;
const int MaxN = 1e5;

map <char, int> res;
map <int, char> ans;
char s[MaxN + 5];

int main()
{
	int k;
	scanf("%s %d", s+1, &k);
	int cnt = 0;
	for(char i = 'a';i <= 'z';i++){
		res[i] = ++cnt;
		ans[cnt] = i;
	}
	int len = strlen(s+1);
	for(int i = 1;i < len;i++){
		if(res[s[i]]+k >= 27){
			k -= 27 - res[s[i]];
			s[i] = 'a';
		}
	}
	k = k%26;
	while(res[s[len]]+k > 26){
		k -= 26;
	}
	s[len] = ans[res[s[len]]+(k%26)];
	printf("%s\n", s+1);
	return 0;
}