#include <iostream> #include <string> using namespace std;
int main() { string s; int n; cin >> s >> n;
// 把字符串变成数字,a=0, b=1, ..., z=25
int arr[1000]; // 假设字符串长度不超过1000
for (int i = 0; i < s.length(); i++) {
arr[i] = s[i] - 'a';
}
int i = 0;
int len = s.length();
while (n > 0 && i < len) {
// 如果已经是z了,跳过
if (arr[i] == 25) {
i++;
continue;
}
// 找到从i开始能操作的最长一段(没有z的)
int j = i;
while (j < len && arr[j] != 25) {
j++;
}
// 计算需要多少次操作能把第一个字符变成z
int need = 25 - arr[i];
// 实际能操作的次数(不能超过n)
int times = min(need, n);
// 把这一段的所有字母都加上times
for (int k = i; k < j; k++) {
arr[k] += times;
}
// 减去用掉的操作次数
n -= times;
}
// 把数字变回字母
string result;
for (int i = 0; i < len; i++) {
result += char('a' + arr[i]);
}
cout << result << endl;
return 0;
}