#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<queue>
#include<vector>
#include<set>
#include<set>
#include<map>
#include<ctime>
#include<iostream>
using namespace std;
typedef long long LL;
const int maxn = 1e5 + 5;
char A[maxn];
int main()
{
	LL N;
	while( ~scanf(" %s",A) ){
		scanf(" %lld",&N);
		int len = strlen(A);
		for( int i = 0 ; i < len ; i++ ){
			int m = 'z' - A[i] + 1;
			if( N >= m ){
				N = N - m;
				A[i] = 'a';
			}
			if( N == 0 ) break;
			if( N > 0 && i == len - 1 ){
				for( int j = 1 ; j <= N ; j++ ){
					if( A[i] < 'z' )	A[i] += 1;
					else if( A[i] == 'z' )	A[i] = 'a';
				}
			}
		}
		printf("%s\n",A);
		memset( A , ' ' , sizeof(A) );
	}
}