from string import ascii_lowercase



s = eval(input())

k = int(eval(input()))



b = ord('a')



ret = ''

for c in s[:-1]:

    if c == 'a':

        ret += 'a'

        continue

    need = 26 - (ord(c) - b)

    if k >= need:

        k -= need

        ret += 'a'

    else:

        ret += c



k %= 26



c = s[-1]

ret += chr((ord(c) - b + k) % 26 + b)



print(ret)

from string import ascii_lowercase



s = eval(input())

k = int(eval(input()))



d = {c: (26 - i) % 26 for i, c in enumerate(ascii_lowercase)}



ret = ''

for c in s[:-1]:

    if d[c] <= k:

        k -= d[c]

        ret += 'a'

    else:

        ret += c



k %= 26

idx = (ascii_lowercase.index(s[-1]) + k) % 26

c = ascii_lowercase[idx]

ret += c



print(ret)

from string import ascii_lowercase

s = eval(input())
k = int(eval(input()))
b = ord("a")
ret = ""
for c in s[:-1]:
    if c == "a":
        ret += "a"
        continue
    need = 26 - (ord(c) - b)
    if k >= need:
        k -= need
        ret += "a"
    else:
        ret += c
k %= 26
c = s[-1]
ret += chr((ord(c) - b + k) % 26 + b)
print(ret)

from string import ascii_lowercase

s = eval(input())
k = int(eval(input()))
d = {c: (26 - i) % 26 for i, c in enumerate(ascii_lowercase)}
ret = ""
for c in s[:-1]:
    if d[c] <= k:
        k -= d[c]
        ret += "a"
    else:
        ret += c
k %= 26
idx = (ascii_lowercase.index(s[-1]) + k) % 26
c = ascii_lowercase[idx]
ret += c
print(ret)

-b = ord("a") +d = {c: (26 - i) % 26 for i, c in enumerate(ascii_lowercase)} -    if c == "a": -        ret += "a" -        continue -    need = 26 - (ord(c) - b) -    if k >= need: -        k -= need +    if d[c] <= k: +        k -= d[c] -c = s[-1] -ret += chr((ord(c) - b + k) % 26 + b) +idx = (ascii_lowercase.index(s[-1]) + k) % 26 +c = ascii_lowercase[idx] +ret += c