s=list(eval(input()))

K=int(eval(input()))



def calcCostToGetA(char):

  if char=='a':

    return 0

  return (ord("z")+1)-ord(char)



for i in range(len(s)):

  cost=calcCostToGetA(s[i])

  if cost<=K:

    s[i]='a'

    K-=cost

    if K==0:

      break



if K>0:

  s[-1]=chr(ord(s[-1])+K%26)

  

print(("".join(s)))
# 頭から順にaに変えていく



import sys

readline = sys.stdin.readline



S = list(readline().rstrip())

K = int(readline())



z = ord("z")

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

  # aにするためのコストを求める

  if S[i] == "a":

    continue

  cost = z + 1 - ord(S[i])

  if cost <= K:

    S[i] = "a"

    K -= cost



K %= 26

nex = ord(S[-1]) + K

if nex > ord("z"):

  nex -= 26

S[-1] = chr(nex)



print(("".join(S)))

s = list(eval(input()))
K = int(eval(input()))


def calcCostToGetA(char):
    if char == "a":
        return 0
    return (ord("z") + 1) - ord(char)


for i in range(len(s)):
    cost = calcCostToGetA(s[i])
    if cost <= K:
        s[i] = "a"
        K -= cost
        if K == 0:
            break
if K > 0:
    s[-1] = chr(ord(s[-1]) + K % 26)
print(("".join(s)))

# 頭から順にaに変えていく
import sys

readline = sys.stdin.readline
S = list(readline().rstrip())
K = int(readline())
z = ord("z")
for i in range(len(S) - 1):
    # aにするためのコストを求める
    if S[i] == "a":
        continue
    cost = z + 1 - ord(S[i])
    if cost <= K:
        S[i] = "a"
        K -= cost
K %= 26
nex = ord(S[-1]) + K
if nex > ord("z"):
    nex -= 26
S[-1] = chr(nex)
print(("".join(S)))

-s = list(eval(input())) -K = int(eval(input())) +# 頭から順にaに変えていく +import sys - -def calcCostToGetA(char): -    if char == "a": -        return 0 -    return (ord("z") + 1) - ord(char) - - -for i in range(len(s)): -    cost = calcCostToGetA(s[i]) +readline = sys.stdin.readline +S = list(readline().rstrip()) +K = int(readline()) +z = ord("z") +for i in range(len(S) - 1): +    # aにするためのコストを求める +    if S[i] == "a": +        continue +    cost = z + 1 - ord(S[i]) -        s[i] = "a" +        S[i] = "a" -        if K == 0: -            break -if K > 0: -    s[-1] = chr(ord(s[-1]) + K % 26) -print(("".join(s))) +K %= 26 +nex = ord(S[-1]) + K +if nex > ord("z"): +    nex -= 26 +S[-1] = chr(nex) +print(("".join(S)))