import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
	auto s = readln.chomp.map!(to!char).array;
  auto k = readln.chomp.to!int;
  foreach (i; 0..s.length-1) {
    if (s[i] == 'a') continue;
    if (26 - (s[i] - 'a') > k) continue;
    k -= 26 - (s[i] - 'a');
    s[i] = 'a';
  }
  s[$-1] = ('a' + (s[$-1] - 'a' + k) % 26).to!char;
  s.writeln;
}
