#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
int main ()
{
	char s[100009];
	int k;
	scanf("%s",&s);
	scanf("%d",&k);
	int cnt = k;
	int len = strlen(s);
	for (int i = 0; i < len; i++)
	{
		while (s[i] != 'a' && i != len-1){
			int d = 26 - (s[i]  - 'a');
			if (cnt - d > 0){
				cnt -= d;
				s[i] = 'a';
			}
			else break;
		}
		if (i == len-1) {
			if (s[i] + cnt <= 'z')
			s[i] = s[i] + cnt;
			else s[i] = s[i] + cnt - 26;
		}
	}
	printf("%s",s);
	return 0;
}