/*#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <array>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
*/

#include <bits/stdc++.h>
using namespace std;

#define int long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define SORT(c) sort((c).begin(),(c).end())

typedef long long ll;
const ll INF = LLONG_MAX - 100;
const ll mod = 1e9 + 7;
const int MAX_N = 5e5 + 5;
int dx[] = { -1LL,0,1LL,0 }, dy[] = { 0,1LL,0,-1LL };
vector<ll> prime;

ll inv[MAX_N], fac[MAX_N];

template <class T = ll> T in() { T x; cin >> x; return (x); }
inline ll GCD(ll a, ll b) { ll c; while (b != 0) { c = a % b; a = b; b = c; }return a; }
inline ll LCM(ll a, ll b) { return a * b / GCD(a, b); }
inline ll POW(ll a, ll b) { ll c = 1LL; while (b > 0) { if (b & 1LL) { c = a * c%mod; }a = a * a%mod; b >>= 1LL; }return c; }
inline void _nCr() { fac[0] = 1LL; for (int i = 1LL; i < MAX_N; i++) { fac[i] = fac[i - 1LL] * i%mod; }for (int i = 0; i < MAX_N; i++) { inv[i] = POW(fac[i], mod - 2); } }
inline ll nCr(ll n, ll r) { return (fac[n] * inv[r] % mod)*inv[n - r] % mod; }
inline void PRI(ll n) { bool a[n + 1LL]; for (int i = 0; i < n + 1LL; i++) { a[i] = 1LL; }for (int i = 2; i < n + 1LL; i++) { if (a[i]) { prime.pb(i); ll b = i; while (b <= n) { a[b] = 0; b += i; } } } }

// class segtree {
// public:
// 	int p = 2;
// 	vector<int> B;
// 	segtree(vector<int> &A) {
// 		while (A.size() > p) p *= 2;
// 		B = vector<int>(2*p-1,INF);
// 		for (int i = 0;i < A.size();i++) {
// 			B[p-1+i] = A[i];
// 		}
// 		for (int i = p - 2;i >= 0;i--) {
// 			B[i] = min(B[i*2+1],B[i*2+2]);
// 		}
// 	}

// 	void update(int pos) {
// 		pos += p-1;
// 		B[pos] = {'~',0};
// 		pos = (pos-1)/2;
// 		while (pos >= 0) {
// 			B[pos].first = min(B[pos*2+1].first,B[pos*2+2].first);
// 			B[pos].second = B[pos*2+1].second + B[pos*2+2].second;
// 			if (pos == 0) break;
// 			pos = (pos-1)/2;
// 		}
// 	}

// 	int getval(int start,int end,int k = 0,int l = 0,int r = -1) {
// 		if (r < 0) r = p - 1;
// 		if (start <= l && r <= end) {return B[k];}
// 		if (r < start || end < l) {return INF;}
// 		int L,R;
// 		L = getval(start,end,k*2+1,l,(l+r)/2);
// 		R = getval(start,end,k*2+2,(l+r)/2+1,r);
// 		return min(L,R);
// 	}
// };

class LazySegTree {
public:
    int p = 2;
    vector<int> node, lazy;
    vector<bool> islazy;
    LazySegTree(vector<int> &A) {
        while (A.size() > p) p *= 2;
        node = vector<int>(2*p-1,INF);
        lazy = vector<int>(2*p-1,0);
        islazy = vector<bool>(2*p-1,false);

        for (int i = 0;i < A.size();i++) {
            node[p-1+i] = A[i];
        }
        for (int i = p - 2;i >= 0;i--) {
            node[i] = max(node[i*2+1],node[i*2+2]);
        }
    }

    void eval(int k, int l, int r) {
        //値の伝播
        if (islazy[k]) {
            node[k] = max(node[k],lazy[k]);
            if (r - l > 1) {
                lazy[k*2+1] = max(lazy[k*2+1],lazy[k]);
                lazy[k*2+2] = max(lazy[k*2+2],lazy[k]);
                islazy[k*2+1] = islazy[k*2+2] = true;
            }
            islazy[k] = false;
            lazy[k] = -INF;
        }
    }

    //半開区間!!!!!!!!!!
    void update(int L, int R, ll x, int k = 0, int l = 0, int r = -1) {
        if (r < 0) r = p;
        //k番ノードに遅延評価
        eval(k, l, r);
        if (R <= l || r <= L) return;
        if (L <= l && r <= R) {
            islazy[k] = true;
            lazy[k] = max(lazy[k],x);
            eval(k,l,r);
        }
        else {
            update(L, R, x, 2*k+1, l, (l+r)/2);
            update(L, R, x, 2*k+2, (l+r)/2, r);
            node[k] = max(node[2*k+1],node[2*k+2]);
        }
    }
 
    int getval(int L,int R,int k = 0,int l = 0,int r = -1) {
        if (r < 0) r = p;
        if (R <= l || r <= L) {return -INF;}

        eval(k,l,r);
        if (L <= l && r <= R) {return node[k];}
        int nl,nr;
        nl = getval(L,R,k*2+1,l,(l+r)/2);
        nr = getval(L,R,k*2+2,(l+r)/2,r);
        return max(nl,nr);
    }
};

signed main() {
	string s; int k; cin >> s >> k;
    int cnt[s.size()];
    REP (i,s.size()) {
        cnt[i] = s[i] - 'a';
        cnt[i] = (26 - cnt[i]) % 26;
    }
    REP (i,s.size()) {
        if (k >= cnt[i]) {
            s[i] = 'a';
            k -= cnt[i];
        }
    }
    if (k > 0) {
        k %= 26;
        int next = (s[s.size()-1] + k - 'a') % 26;
        s[s.size()-1] = 'a' + next;
    }
    cout << s << endl;
}


Measured memory_bytes: 1408