local s=io.read()
local sable={}
for i=1,#s do
    sable[i]=s:byte(i)-97
end
local k=io.read("n")
for i=1,#s do
    local a=sable[i]
    if i~=#s and k>=26-a and a>0 then
        sable[i]=string.char(97)
        k=k-(26-a)
    elseif i==#s then
        sable[i]=string.char((sable[i]+k)%26+97)
    else
        sable[i]=string.char(sable[i]+97)
    end
end
print(table.concat(sable,""))