s = input().strip()

K = int(eval(input()))

if K>len(s)*26:

    d = (K-len(s)*26)//26

    K = K-26*d

x = ""

for i in range(len(s)):

    if i<len(s)-1 and (26-(ord(s[i])-ord("a")))%26 <= K:

        x += "a"

        K -= (26-(ord(s[i])-ord("a")))%26

    elif i<len(s)-1:

        x += s[i]

    elif i==len(s)-1:

        k = ord(s[i])+K%26

        if k<=122:

            x += chr(k)

        else:

            x += chr(k-26)

print(x)
A = {i-97:chr(i) for i in range(97,123)}

B = {v:k for k,v in list(A.items())}

s = list(input().strip())

K = int(eval(input()))

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

    if s[i]!="a" and K>=26-B[s[i]]:

        K -= (26-B[s[i]])

        s[i]="a"

k = K%26

ind = (B[s[-1]]+k)%26

s[-1] = A[ind]

print(("".join(s)))
s = input().strip()
K = int(eval(input()))
if K > len(s) * 26:
    d = (K - len(s) * 26) // 26
    K = K - 26 * d
x = ""
for i in range(len(s)):
    if i < len(s) - 1 and (26 - (ord(s[i]) - ord("a"))) % 26 <= K:
        x += "a"
        K -= (26 - (ord(s[i]) - ord("a"))) % 26
    elif i < len(s) - 1:
        x += s[i]
    elif i == len(s) - 1:
        k = ord(s[i]) + K % 26
        if k <= 122:
            x += chr(k)
        else:
            x += chr(k - 26)
print(x)

A = {i - 97: chr(i) for i in range(97, 123)}
B = {v: k for k, v in list(A.items())}
s = list(input().strip())
K = int(eval(input()))
for i in range(len(s) - 1):
    if s[i] != "a" and K >= 26 - B[s[i]]:
        K -= 26 - B[s[i]]
        s[i] = "a"
k = K % 26
ind = (B[s[-1]] + k) % 26
s[-1] = A[ind]
print(("".join(s)))

-s = input().strip() +A = {i - 97: chr(i) for i in range(97, 123)} +B = {v: k for k, v in list(A.items())} +s = list(input().strip()) -if K > len(s) * 26: -    d = (K - len(s) * 26) // 26 -    K = K - 26 * d -x = "" -for i in range(len(s)): -    if i < len(s) - 1 and (26 - (ord(s[i]) - ord("a"))) % 26 <= K: -        x += "a" -        K -= (26 - (ord(s[i]) - ord("a"))) % 26 -    elif i < len(s) - 1: -        x += s[i] -    elif i == len(s) - 1: -        k = ord(s[i]) + K % 26 -        if k <= 122: -            x += chr(k) -        else: -            x += chr(k - 26) -print(x) +for i in range(len(s) - 1): +    if s[i] != "a" and K >= 26 - B[s[i]]: +        K -= 26 - B[s[i]] +        s[i] = "a" +k = K % 26 +ind = (B[s[-1]] + k) % 26 +s[-1] = A[ind] +print(("".join(s)))