s = list(eval(input()))

k = int(eval(input()))

abc = "abcdefghijklmnopqrstuvwxyz"

c = 0

for e,i in enumerate(s):

    # print(26-abc.index(i))

    if k-26+abc.index(i)>=0 and i!='a':

        s[e] = 'a'

        k-=26-abc.index(i)

    # print(k)  

k+=abc.index(s[-1])

k%=26

s[-1] = abc[k]



print(("".join(s)))
s=list(eval(input()))

k=int(eval(input()))

for e,i in enumerate(s):

    c=(123-ord(i))%26

    if k>=c:

        s[e]="a"

        k-=c

    else:s[e]=i

l = chr((ord(s[-1])-97+k)%26+97)

print(("".join(s[:-1])+l))

s = list(eval(input()))
k = int(eval(input()))
abc = "abcdefghijklmnopqrstuvwxyz"
c = 0
for e, i in enumerate(s):
    # print(26-abc.index(i))
    if k - 26 + abc.index(i) >= 0 and i != "a":
        s[e] = "a"
        k -= 26 - abc.index(i)
    # print(k)
k += abc.index(s[-1])
k %= 26
s[-1] = abc[k]
print(("".join(s)))

s = list(eval(input()))
k = int(eval(input()))
for e, i in enumerate(s):
    c = (123 - ord(i)) % 26
    if k >= c:
        s[e] = "a"
        k -= c
    else:
        s[e] = i
l = chr((ord(s[-1]) - 97 + k) % 26 + 97)
print(("".join(s[:-1]) + l))

-abc = "abcdefghijklmnopqrstuvwxyz" -c = 0 -    # print(26-abc.index(i)) -    if k - 26 + abc.index(i) >= 0 and i != "a": +    c = (123 - ord(i)) % 26 +    if k >= c: -        k -= 26 - abc.index(i) -    # print(k) -k += abc.index(s[-1]) -k %= 26 -s[-1] = abc[k] -print(("".join(s))) +        k -= c +    else: +        s[e] = i +l = chr((ord(s[-1]) - 97 + k) % 26 + 97) +print(("".join(s[:-1]) + l))