#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<cstring>
using namespace std;
char s[111111];
int dfs(int a, int b, int c)
{
	if(s[a] == 'a' && a < c && b > 0)
	{
		dfs(a + 1, b, c);
	}
	else if(a == c && b > 0)
	{
		b = b % 26;
		s[a] = s[a] + b;
		b = 0;
	}
	else if(a < c && b > 0)
	{
		if('z' - s[a] + 1 <= b)
		{
			b = b - ('z' - s[a] + 1);
			s[a] = 'a';
			dfs(a, b, c);
		}
		else
		{
			dfs(a + 1, b, c);
		}
	}
}
int main()
{
	int k;
	scanf("%s", &s);
	scanf("%d", &k);
	dfs(0, k, strlen(s) - 1);
	printf("%s\n", s);
}