#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<string>
#include<iostream>
#include<cstdlib>
using namespace std;
const int MaxN = 1e5 + 5;
char a[MaxN];
int main()
{
	long long k;
	int m;
	cin >> a;
	scanf("%lld", &k);
	int len = strlen(a);
	for(int i = 0; i < len-1; i++) {
		m = 'z' + 1 - a[i];
		k = k - m;
		if(k > 0) a[i] = 'a';
		else k = k + m;
	}
	a[len - 1] = a[len - 1] + k;
	if(a[len - 1] > 'z') a[len - 1] = a[len - 1] - 26;
	//printf("%c", a[len - 1] + k);
	cout << a << endl;
}
		
	