unittest
{
	assert( [ "xyz", "4" ].parse.expand.solve == "aya" );
	assert( [ "a", "25" ].parse.expand.solve == "z" );
	assert( [ "codefestival", "100" ].parse.expand.solve == "aaaafeaaivap" );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto s = input.front.to!( dchar[] );
	input.popFront;
	auto k = input.front.to!( long );
	return tuple( s, k );
}

auto solve( dchar[] s, long k )
{
	foreach( ref c; s )
	{
		auto i = cast( long )( 'z' - c + 1 );
		if( k < i ) continue;
		c = 'a';
		k -= i;
	}
	if( 0 < k )
	{
		auto i = cast( long )( 'z' - s[ $ - 1 ] + 1 );
		if( k < i ) s[ $ - 1 ] += k;
		else        s[ $ - 1 ]  = 'a' + ( k - i ) % 26;
	}
	return s;
}
