#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
const int maxn=1e5;
int b[maxn+3],c[maxn+3];
int main(){
	int k;
   char a[maxn+3];
    gets(a);
    cin>>k;
    int n=strlen(a);
    for(int i=0;i<n;i++){
    	b[i]='z'-a[i]+1;
	}
	for(int i=0;i<n;i++){
		if(k>=b[i]){
			a[i]='a';
			k-=b[i];
			}
	}
	if(k!=0)a[n-1]+=k;
    puts(a);
}


