#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;

const int MAXN = 1e5;

char s[MAXN + 5],ans[MAXN + 5];
int a[MAXN + 5],b[MAXN + 5];
bool q = 0;
int sum = 0,k;

int main(){
	cin >> s+1;
	cin >> k;
	int len = strlen(s+1);
	for(int i = 1;i <= len;i++){
		a[i] = (int)s[i];
	}
	for(int i = 1;i <= len;i++){
		if(k ==0)break;
		if(a[i] == 97)continue;
		else{
			if(a[i]+k >122){
				k =k - (122 - a[i]+1);
				a[i] = 97;	
			}
			else continue;
		}
	}
	if(k != 0){
		if(k > 26)k %=26;
		a[len] += k;
		if(a[len] > 122){
			a[len] = 97 + a[len] - 122;
		}
	}
	for(int i = 1;i <= len;i++){
		cout << (char)a[i];
	}
	cout << endl;
}