#include<bits/stdc++.h>
using namespace std;
string S;
int K;
int main(){
  cin >> S;
  cin >> K;

  int n = S.size();
  for(int i=0;i<n;i++){
    if( S[i] == 'a' ) continue;
    if( 'z'+1 - S[i] <= K ) {
      int c = 'z'+1 - S[i];
      K -= c;
      S[i] = 'a';
    }
  }

  if( K ){
    K%=26;
    S[n-1] += K;
  }
  cout << S << endl;
}
