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