s=list(eval(input()))

N=int(eval(input()))



apple=lambda c:ord(c)-ord("a")+1



l=[]

for i in range(len(s)):

    s[i]=apple(s[i])

    dif=27-s[i]

    if s[i]==1:

        pass

    elif dif<=N:

        N-=dif

        s[i]=1



s[-1]-=1

s[-1]=(s[-1]+N)%26

s[-1]+=1



kiss = lambda c: chr(c+96)

for i in range(len(s)):

    s[i]=kiss(s[i])



print(("".join(s)))
# coding: utf-8

# Your code here!

s=eval(input())

K=int(eval(input()))



ans=[]

#122

for item in s[:len(s)-1]:

    cost=(123-ord(item))

    if item=="a":

        ans.append(item)

        continue

    if K>=cost:

        K-=cost

        ans.append("a")

    else:

        ans.append(item)



K%=26

last=ord(s[-1])

if last+K>122:

    ans.append(chr(last+K-26))

else:

    ans.append(chr(last+K))



print(("".join(ans)))

    
s = list(eval(input()))
N = int(eval(input()))
apple = lambda c: ord(c) - ord("a") + 1
l = []
for i in range(len(s)):
    s[i] = apple(s[i])
    dif = 27 - s[i]
    if s[i] == 1:
        pass
    elif dif <= N:
        N -= dif
        s[i] = 1
s[-1] -= 1
s[-1] = (s[-1] + N) % 26
s[-1] += 1
kiss = lambda c: chr(c + 96)
for i in range(len(s)):
    s[i] = kiss(s[i])
print(("".join(s)))

# coding: utf-8
# Your code here!
s = eval(input())
K = int(eval(input()))
ans = []
# 122
for item in s[: len(s) - 1]:
    cost = 123 - ord(item)
    if item == "a":
        ans.append(item)
        continue
    if K >= cost:
        K -= cost
        ans.append("a")
    else:
        ans.append(item)
K %= 26
last = ord(s[-1])
if last + K > 122:
    ans.append(chr(last + K - 26))
else:
    ans.append(chr(last + K))
print(("".join(ans)))

-s = list(eval(input())) -N = int(eval(input())) -apple = lambda c: ord(c) - ord("a") + 1 -l = [] -for i in range(len(s)): -    s[i] = apple(s[i]) -    dif = 27 - s[i] -    if s[i] == 1: -        pass -    elif dif <= N: -        N -= dif -        s[i] = 1 -s[-1] -= 1 -s[-1] = (s[-1] + N) % 26 -s[-1] += 1 -kiss = lambda c: chr(c + 96) -for i in range(len(s)): -    s[i] = kiss(s[i]) -print(("".join(s))) +# coding: utf-8 +# Your code here! +s = eval(input()) +K = int(eval(input())) +ans = [] +# 122 +for item in s[: len(s) - 1]: +    cost = 123 - ord(item) +    if item == "a": +        ans.append(item) +        continue +    if K >= cost: +        K -= cost +        ans.append("a") +    else: +        ans.append(item) +K %= 26 +last = ord(s[-1]) +if last + K > 122: +    ans.append(chr(last + K - 26)) +else: +    ans.append(chr(last + K)) +print(("".join(ans)))