import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.math;


void main() {
    char[] s = readln.chomp.to!(char[]);
    int k; scan(k);

    foreach (i ; 0 .. s.length.to!int - 1) {
        if (s[i] == 'a') continue;
        int t = 26 - (s[i] - 'a');
        if (t <= k) {
            k -= t;
            s[i] = 'a';
        }
    }

    k %= 26;
    s[$ - 1] = (s[$ - 1] - 'a' + k) % 26 + 'a';

    writeln(s);
}



void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
