from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

import sys,bisect,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



s = eval(input())

n = len(s)

r = [ord('z') - ord(t) + 1 if t != 'a' else 0 for t in s]

res = [None] * n

k = inp()

for i,x in enumerate(r):

    if x <= k:

        res[i] = 'a'

        k -= x

if k > 0:

    tmp = 'a' if res[-1] != None else s[-1]

    res[-1] = chr((ord(tmp) - ord('a') + k)%26 + ord('a'))

for i,t in enumerate(res):

    if t == None:

        res[i] = s[i]

print((''.join(res)))
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



s = list(eval(input()))

k = inp()

n = len(s)

nxa = ord('z') + 1



for i,x in enumerate(s):

    if x == 'a':

        continue

    rem = nxa - ord(x)

    if rem <= k:

        s[i] = 'a'

        k -= rem

if k > 0:

    s[-1] = chr(ord('a') + (ord(s[-1])-ord('a')+k)%26)

print((''.join(s)))
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


s = eval(input())
n = len(s)
r = [ord("z") - ord(t) + 1 if t != "a" else 0 for t in s]
res = [None] * n
k = inp()
for i, x in enumerate(r):
    if x <= k:
        res[i] = "a"
        k -= x
if k > 0:
    tmp = "a" if res[-1] != None else s[-1]
    res[-1] = chr((ord(tmp) - ord("a") + k) % 26 + ord("a"))
for i, t in enumerate(res):
    if t == None:
        res[i] = s[i]
print(("".join(res)))

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


s = list(eval(input()))
k = inp()
n = len(s)
nxa = ord("z") + 1
for i, x in enumerate(s):
    if x == "a":
        continue
    rem = nxa - ord(x)
    if rem <= k:
        s[i] = "a"
        k -= rem
if k > 0:
    s[-1] = chr(ord("a") + (ord(s[-1]) - ord("a") + k) % 26)
print(("".join(s)))

-from heapq import heappop, heappush, heapify -import sys, bisect, math, itertools, fractions, pprint +from heapq import heappop, heappush +from bisect import bisect_left, bisect_right +import sys, math, itertools, fractions, pprint -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - -s = eval(input()) +s = list(eval(input())) +k = inp() -r = [ord("z") - ord(t) + 1 if t != "a" else 0 for t in s] -res = [None] * n -k = inp() -for i, x in enumerate(r): -    if x <= k: -        res[i] = "a" -        k -= x +nxa = ord("z") + 1 +for i, x in enumerate(s): +    if x == "a": +        continue +    rem = nxa - ord(x) +    if rem <= k: +        s[i] = "a" +        k -= rem -    tmp = "a" if res[-1] != None else s[-1] -    res[-1] = chr((ord(tmp) - ord("a") + k) % 26 + ord("a")) -for i, t in enumerate(res): -    if t == None: -        res[i] = s[i] -print(("".join(res))) +    s[-1] = chr(ord("a") + (ord(s[-1]) - ord("a") + k) % 26) +print(("".join(s)))