#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
string s;
int k,a[100005],minn=30,f;
int main()
{
	cin>>s>>k;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]!='a')
		{
		f=1;break;	
		}
	}
	
	if(!f||s.size()==1)
	{
		
		for(int i=1;i<=k;i++)
		{
			if(s[s.size()-1]=='z')
			{
				s[s.size()-1]='a';
			}
			else s[s.size()-1]++;
		
		}
	}
	else{
	
	for(int i=0;i<s.size();i++)
	{
	a[i]='z'-s[i]+1;
	minn=min(minn,a[i]);
	}
	for(int i=0;i<s.size();i++)
	{
		if(k>=minn&&k>=a[i])
		{
			s[i]='a';k-=a[i];
		}
		
	}
	if(k<minn)
	{
		for(int i=s.size()-1;i>=0;i--)
		if(s[i]!='a')
		{s[i]=s[i]+k;
		break;
		}
			
			}}
			cout<<s;
	return 0;
}