s,k,t=eval(input()),int(eval(input())),""

for q in s:

 if(p:=(123-ord(q))%26)<=k:t+="a";k-=p

 else:t+=q

print((t[:-1]+chr((ord(t[-1])-97+k)%26+97)))
s,k=open(0)

k=int(k)

*s,t=s

for q in s:

 if(p:=(123-ord(q))%26)<=k:t+="a";k-=p

 else:t+=q

print((t[1:-1]+chr((ord(t[-1])-97+k)%26+97)))
s, k, t = eval(input()), int(eval(input())), ""
for q in s:
    if (p := (123 - ord(q)) % 26) <= k:
        t += "a"
        k -= p
    else:
        t += q
print((t[:-1] + chr((ord(t[-1]) - 97 + k) % 26 + 97)))

s, k = open(0)
k = int(k)
*s, t = s
for q in s:
    if (p := (123 - ord(q)) % 26) <= k:
        t += "a"
        k -= p
    else:
        t += q
print((t[1:-1] + chr((ord(t[-1]) - 97 + k) % 26 + 97)))

-s, k, t = eval(input()), int(eval(input())), "" +s, k = open(0) +k = int(k) +*s, t = s -print((t[:-1] + chr((ord(t[-1]) - 97 + k) % 26 + 97))) +print((t[1:-1] + chr((ord(t[-1]) - 97 + k) % 26 + 97)))