#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 5;
char s[N];
int n, k;

int main() {
  scanf("%s%d", s, &k);
  n = strlen(s);
  for (int  i = 0; i < n; i++) {
    if (s[i] == 'a')
      continue;
    if ('z' - s[i] + 1 <= k) {
      k -= 'z' - s[i] + 1;
      s[i] = 'a';
    }
  }
  k %= 26;
  while (k--) {
    s[n-1]++;
  }
  printf("%s\n", s);
  return 0;
}