#include <bits/stdc++.h>

using namespace std;

string s;
int k;

int main()
{
	cin >> s >> k;
	for (int i = 0; i < s.length(); i++)
	{
		if (s[i] == 'a') continue;
		if (k >= 'z' + 1 - s[i])
		{
			k -= 'z' + 1 - s[i];
			s[i] = 'a';
		}
	}
	int last = s.length()-1;
	s[last] = (s[last] - 'a' + k % 26) % 26 + 'a';
	cout << s << '\n';
	return 0;
}

