s = list(eval(input()))

K = int(eval(input()))



alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']



for i in range(len(s)):

    if K <=0 :

        break

    if (26 - alphabet.index(s[i])) <= K and s[i] != "a":

        

        K -= (26 - alphabet.index(s[i]))

        s[i] = "a"

#         print(K)



if K > 0:

    if K%26 + alphabet.index(s[-1]) > 25:

        s[-1] = alphabet[(K%26 - alphabet.index(s[-1]))]

    else:

        s[-1] = alphabet[(K%26+alphabet.index(s[-1]))]

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

K = int(eval(input()))



alphabet = "abcdefghijklmnopqrstuvwxyz"



for i in range(len(s)):

    if (26 - alphabet.index(s[i])) <= K and (s[i] != "a"):

        K -= (26 - alphabet.index(s[i]))

        s[i] = "a"

        

    if K <= 0:

        break

        

if K > 0:

    K = K % 26

  

    idx = alphabet.index(s[-1])+K

    s[-1] = alphabet[idx%26]

    

print(("".join(s)))
s = list(eval(input()))
K = int(eval(input()))
alphabet = [
    "a",
    "b",
    "c",
    "d",
    "e",
    "f",
    "g",
    "h",
    "i",
    "j",
    "k",
    "l",
    "m",
    "n",
    "o",
    "p",
    "q",
    "r",
    "s",
    "t",
    "u",
    "v",
    "w",
    "x",
    "y",
    "z",
]
for i in range(len(s)):
    if K <= 0:
        break
    if (26 - alphabet.index(s[i])) <= K and s[i] != "a":
        K -= 26 - alphabet.index(s[i])
        s[i] = "a"
#         print(K)
if K > 0:
    if K % 26 + alphabet.index(s[-1]) > 25:
        s[-1] = alphabet[(K % 26 - alphabet.index(s[-1]))]
    else:
        s[-1] = alphabet[(K % 26 + alphabet.index(s[-1]))]
print(("".join(s)))

s = list(eval(input()))
K = int(eval(input()))
alphabet = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(s)):
    if (26 - alphabet.index(s[i])) <= K and (s[i] != "a"):
        K -= 26 - alphabet.index(s[i])
        s[i] = "a"
    if K <= 0:
        break
if K > 0:
    K = K % 26
    idx = alphabet.index(s[-1]) + K
    s[-1] = alphabet[idx % 26]
print(("".join(s)))

-alphabet = [ -    "a", -    "b", -    "c", -    "d", -    "e", -    "f", -    "g", -    "h", -    "i", -    "j", -    "k", -    "l", -    "m", -    "n", -    "o", -    "p", -    "q", -    "r", -    "s", -    "t", -    "u", -    "v", -    "w", -    "x", -    "y", -    "z", -] +alphabet = "abcdefghijklmnopqrstuvwxyz" +    if (26 - alphabet.index(s[i])) <= K and (s[i] != "a"): +        K -= 26 - alphabet.index(s[i]) +        s[i] = "a" -    if (26 - alphabet.index(s[i])) <= K and s[i] != "a": -        K -= 26 - alphabet.index(s[i]) -        s[i] = "a" -#         print(K) -    if K % 26 + alphabet.index(s[-1]) > 25: -        s[-1] = alphabet[(K % 26 - alphabet.index(s[-1]))] -    else: -        s[-1] = alphabet[(K % 26 + alphabet.index(s[-1]))] +    K = K % 26 +    idx = alphabet.index(s[-1]) + K +    s[-1] = alphabet[idx % 26]