var lines = []; var result = "";
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    var s = lines[0].split("");
    var K = Number(lines[1]);
    var len = s.length;

    var s_code = Array(len).fill(0)
    for (var i = 0; i < len; i++) {
        s_code[i] = s[i].charCodeAt(0);
    }

    for (var i = 0; i < len; i++) {
        if (i === len - 1) {
            K = K % 26;
            s_code[i] + K > "z".charCodeAt(0) ? s_code[i] = 97 + s_code[i] + K - "z".charCodeAt(0) - 1 : s_code[i] += K;
        }
        else {
            if ("z".charCodeAt(0) - s_code[i] + 1 <= K && s_code[i] !== "a".charCodeAt(0)) { K -= "z".charCodeAt(0) - s_code[i] + 1; s_code[i] = "a".charCodeAt(0); }
        }
        if (K <= 0) { break };
    }

    for (var i = 0; i < len; i++) {
        result += String.fromCharCode(s_code[i]);
    }
    console.log(result);
});