S = eval(input())

K = int(eval(input()))

cost = [(ord("z") - ord(s) + 1) % 26 for s in S]

A = [chr(ord("a") + i) for i in range(26)]



ans = ""

for i in range(len(S)-1):

    if cost[i] <= K:

        K -= cost[i]

        ans += "a"

    else:

        ans += S[i]



ans += A[(A.index(S[-1]) + K) % 26]

print(ans)

S = eval(input())

K = int(eval(input()))





Costs = {chr(98 + i): (25 - i) for i in range(25)}

Costs['a'] = 0

alphabets = [chr(97 + i) for i in range(26)]





ans = ""

for i in range(len(S) - 1):

    s = S[i]

    if K >= Costs[s]:

        K -= Costs[s]

        ans += 'a'

    else:

        ans += s





ans += alphabets[(alphabets.index(S[-1]) + K) % 26]

print(ans)

S = eval(input())
K = int(eval(input()))
cost = [(ord("z") - ord(s) + 1) % 26 for s in S]
A = [chr(ord("a") + i) for i in range(26)]
ans = ""
for i in range(len(S) - 1):
    if cost[i] <= K:
        K -= cost[i]
        ans += "a"
    else:
        ans += S[i]
ans += A[(A.index(S[-1]) + K) % 26]
print(ans)

S = eval(input())
K = int(eval(input()))
Costs = {chr(98 + i): (25 - i) for i in range(25)}
Costs["a"] = 0
alphabets = [chr(97 + i) for i in range(26)]
ans = ""
for i in range(len(S) - 1):
    s = S[i]
    if K >= Costs[s]:
        K -= Costs[s]
        ans += "a"
    else:
        ans += s
ans += alphabets[(alphabets.index(S[-1]) + K) % 26]
print(ans)

-cost = [(ord("z") - ord(s) + 1) % 26 for s in S] -A = [chr(ord("a") + i) for i in range(26)] +Costs = {chr(98 + i): (25 - i) for i in range(25)} +Costs["a"] = 0 +alphabets = [chr(97 + i) for i in range(26)] -    if cost[i] <= K: -        K -= cost[i] +    s = S[i] +    if K >= Costs[s]: +        K -= Costs[s] -        ans += S[i] -ans += A[(A.index(S[-1]) + K) % 26] +        ans += s +ans += alphabets[(alphabets.index(S[-1]) + K) % 26]