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)):

    s = S[i]

    if K >= Costs[s]:

        K -= Costs[s]

        ans += 'a'

    else:

        ans += s





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

print(ans)

S = eval(input())

K = int(eval(input()))



ans = ''

for s in S:

    to_a_cost = (26 - (ord(s) - 97)) % 26

    if to_a_cost <= K:

        ans += 'a'

        K -= to_a_cost

    else:

        ans += s





if K:

    K %= 26

    ans = ans[:-1] + chr(97 + (((ord(ans[-1]) - 97) + 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)):
    s = S[i]
    if K >= Costs[s]:
        K -= Costs[s]
        ans += "a"
    else:
        ans += s
ans = ans[:-1] + alphabets[(alphabets.index(ans[-1]) + K) % 26]
print(ans)

S = eval(input())
K = int(eval(input()))
ans = ""
for s in S:
    to_a_cost = (26 - (ord(s) - 97)) % 26
    if to_a_cost <= K:
        ans += "a"
        K -= to_a_cost
    else:
        ans += s
if K:
    K %= 26
    ans = ans[:-1] + chr(97 + (((ord(ans[-1]) - 97) + K) % 26))
print(ans)

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