s = input()

K = int(input())

_s, _K = s[:], K

a = "abcdefghijklmnopqrstuvwxyz"

ai = a.index("a")

zi = a.index("z") 

si = [zi - a.index(c) + 1 if c != "a" else 0  for c in s]



for i, (c, ci) in enumerate(zip(s, si)):

    if K == 0:

        break

    if c == "a":

        continue

    if ci <= K:

        s = s[0:i] + "a" + s[i+1:]

        K = K - ci



K = K % len(a)

if K > 0:

    s = s[:-1] + a[a.index(s[-1]) + K]



print(s)
s = input()

s = list(s)

K = int(input())

# _s, _K = s[:], K

a = "abcdefghijklmnopqrstuvwxyz"

# ai = a.index("a")

zi = a.index("z") 

si = [zi - a.index(c) + 1 if c != "a" else 0  for c in s]



for i, (c, ci) in enumerate(zip(s, si)):

    if K == 0:

        break

    if c == "a":

        continue

    if ci <= K:

        s[i] = 'a'

        K = K - ci



K = K % len(a)

if K > 0:

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



print(("".join(s)))
s = input()
K = int(input())
_s, _K = s[:], K
a = "abcdefghijklmnopqrstuvwxyz"
ai = a.index("a")
zi = a.index("z")
si = [zi - a.index(c) + 1 if c != "a" else 0 for c in s]
for i, (c, ci) in enumerate(zip(s, si)):
    if K == 0:
        break
    if c == "a":
        continue
    if ci <= K:
        s = s[0:i] + "a" + s[i + 1 :]
        K = K - ci
K = K % len(a)
if K > 0:
    s = s[:-1] + a[a.index(s[-1]) + K]
print(s)

s = input()
s = list(s)
K = int(input())
# _s, _K = s[:], K
a = "abcdefghijklmnopqrstuvwxyz"
# ai = a.index("a")
zi = a.index("z")
si = [zi - a.index(c) + 1 if c != "a" else 0 for c in s]
for i, (c, ci) in enumerate(zip(s, si)):
    if K == 0:
        break
    if c == "a":
        continue
    if ci <= K:
        s[i] = "a"
        K = K - ci
K = K % len(a)
if K > 0:
    s[-1] = a[a.index(s[-1]) + K]
print(("".join(s)))

+s = list(s) -_s, _K = s[:], K +# _s, _K = s[:], K -ai = a.index("a") +# ai = a.index("a") -        s = s[0:i] + "a" + s[i + 1 :] +        s[i] = "a" -    s = s[:-1] + a[a.index(s[-1]) + K] -print(s) +    s[-1] = a[a.index(s[-1]) + K] +print(("".join(s)))