def cost_for_next_a(c):

    return 123 - ord(c)



s = eval(input())

K = int(eval(input()))



new_s = ""





for i in range(len(s)):

    c = s[i]

    if i == len(s) - 1:

        if cost_for_next_a(c) <= K:

            new_s += chr(97 + (K - cost_for_next_a(c)) % 26)

        else:

            new_s += chr(ord(c) + K)

    elif c == 'a':

        new_s += 'a'

    elif cost_for_next_a(c) <= K:

        new_s += "a"

        K -= cost_for_next_a(c)

    else:

        new_s += c



print(new_s)

s = eval(input())

K = int(eval(input()))



new_s = ""



# for i in range(len(s)):

#     c = s[i]

#     if i == len(s) - 1:

#         if cost_for_next_a(c) <= K:

#             new_s += chr(97 + (K - cost_for_next_a(c)) % 26)

#         else:

#             new_s += chr(ord(c) + K)

#     elif c == 'a':

#         new_s += 'a'

#     elif cost_for_next_a(c) <= K:

#         new_s += "a"

#         K -= cost_for_next_a(c)

#     else:

#         new_s += c



for i in range(len(s)):

    c = s[i]

    cost = 123 - ord(c)

    if i == len(s) - 1:

        if cost <= K:

            new_s += chr(97 + (K - cost) % 26)

        else:

            new_s += chr(ord(c) + K)

    elif c == 'a':

        new_s += 'a'

    elif cost <= K:

        new_s += "a"

        K -= cost

    else:

        new_s += c



print(new_s)
def cost_for_next_a(c):
    return 123 - ord(c)


s = eval(input())
K = int(eval(input()))
new_s = ""
for i in range(len(s)):
    c = s[i]
    if i == len(s) - 1:
        if cost_for_next_a(c) <= K:
            new_s += chr(97 + (K - cost_for_next_a(c)) % 26)
        else:
            new_s += chr(ord(c) + K)
    elif c == "a":
        new_s += "a"
    elif cost_for_next_a(c) <= K:
        new_s += "a"
        K -= cost_for_next_a(c)
    else:
        new_s += c
print(new_s)

s = eval(input())
K = int(eval(input()))
new_s = ""
# for i in range(len(s)):
#     c = s[i]
#     if i == len(s) - 1:
#         if cost_for_next_a(c) <= K:
#             new_s += chr(97 + (K - cost_for_next_a(c)) % 26)
#         else:
#             new_s += chr(ord(c) + K)
#     elif c == 'a':
#         new_s += 'a'
#     elif cost_for_next_a(c) <= K:
#         new_s += "a"
#         K -= cost_for_next_a(c)
#     else:
#         new_s += c
for i in range(len(s)):
    c = s[i]
    cost = 123 - ord(c)
    if i == len(s) - 1:
        if cost <= K:
            new_s += chr(97 + (K - cost) % 26)
        else:
            new_s += chr(ord(c) + K)
    elif c == "a":
        new_s += "a"
    elif cost <= K:
        new_s += "a"
        K -= cost
    else:
        new_s += c
print(new_s)

-def cost_for_next_a(c): -    return 123 - ord(c) - - +# for i in range(len(s)): +#     c = s[i] +#     if i == len(s) - 1: +#         if cost_for_next_a(c) <= K: +#             new_s += chr(97 + (K - cost_for_next_a(c)) % 26) +#         else: +#             new_s += chr(ord(c) + K) +#     elif c == 'a': +#         new_s += 'a' +#     elif cost_for_next_a(c) <= K: +#         new_s += "a" +#         K -= cost_for_next_a(c) +#     else: +#         new_s += c +    cost = 123 - ord(c) -        if cost_for_next_a(c) <= K: -            new_s += chr(97 + (K - cost_for_next_a(c)) % 26) +        if cost <= K: +            new_s += chr(97 + (K - cost) % 26) -    elif cost_for_next_a(c) <= K: +    elif cost <= K: -        K -= cost_for_next_a(c) +        K -= cost