'use strict';
const inputs = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n');
const CODE_A = 97;
let s = inputs[0];
let K = parseInt(inputs[1]);
let cur = 0;
let result = '';
let lastFailedCur = -1;
let lastFailedCode = -1;

while (K > 0 && cur < s.length) {
	let distance = 26 - (s.charCodeAt(cur) - CODE_A);
	if (distance <= 0) distance = 26;
	
	if (distance <= K) {
		K -= distance;
		result += 'a';
	} else {
		lastFailedCur = cur;
		lastFailedCode = s.charCodeAt(cur);
		result += s[cur];
	}
	
	cur++;
}

if (K > 0) {
	K = K % 26;
	if (lastFailedCode === -1) {
		lastFailedCode = s.length - 1;
	}
	
	result = result.substr(0, lastFailedCur) +
		String.fromCharCode(lastFailedCode + K) +
		result.substr(lastFailedCur + 1);
}

console.log(result);