#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
const int MaxN = 1e5;
char a[MaxN + 5];
int k;

int main()
{
	scanf("%s", a);
	scanf("%d", &k);
	for(int i = 0; i < strlen(a); i++)
	{
		if((k - 1) >= 'z' - a[i])
		{
			k = k - 'z' + a[i] - 1;
			a[i] = 'a';
		}
		else
		{
			continue;
		}
	}
	a[strlen(a) - 1] += k;
	for(int i = 0; i < strlen(a); i++) printf("%c", a[i]);
    printf("\n");
	return 0;
}
