# 入力

import sys

stdin = sys.stdin



def li(): return [int(x) for x in stdin.readline().split()]

def li_(): return [int(x)-1 for x in stdin.readline().split()]

def lf(): return [float(x) for x in stdin.readline().split()]

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(ns())

def nf(): return float(ns())



# ここから処理

s = ns()

k = ni()



chl = list(s)

res = k



for i, c in enumerate(chl):

    if c == "a":

        continue

    

    elif res >= ord("z") - ord(c) + 1:

        chl[i] = "a"

        res -= (ord("z") - ord(c) + 1)



chl[-1] = chr(ord(chl[-1]) + res%26)



print(("".join(chl)))
import sys

stdin = sys.stdin



sys.setrecursionlimit(10 ** 7)



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

def li_(): return [int(x) - 1 for x in stdin.readline().split()]

def lf(): return list(map(float, stdin.readline().split()))

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(stdin.readline())

def nf(): return float(stdin.readline())



NEXA = 26

dic = {chr(97+i): i for i in range(NEXA)}



s = lc()

k = ni()



ans = []



for si in s:

    to_nexa = (NEXA - dic[si]) % NEXA

    if to_nexa <= k:

        k -= to_nexa

        ans.append('a')



    else:

        ans.append(si)



if k > 0:

    ans[-1] = chr(97 + (dic[ans[-1]] + k) % NEXA)



print(("".join(ans)))
# 入力
import sys

stdin = sys.stdin


def li():
    return [int(x) for x in stdin.readline().split()]


def li_():
    return [int(x) - 1 for x in stdin.readline().split()]


def lf():
    return [float(x) for x in stdin.readline().split()]


def ls():
    return stdin.readline().split()


def ns():
    return stdin.readline().rstrip()


def lc():
    return list(ns())


def ni():
    return int(ns())


def nf():
    return float(ns())


# ここから処理
s = ns()
k = ni()
chl = list(s)
res = k
for i, c in enumerate(chl):
    if c == "a":
        continue
    elif res >= ord("z") - ord(c) + 1:
        chl[i] = "a"
        res -= ord("z") - ord(c) + 1
chl[-1] = chr(ord(chl[-1]) + res % 26)
print(("".join(chl)))

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**7)


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


def li_():
    return [int(x) - 1 for x in stdin.readline().split()]


def lf():
    return list(map(float, stdin.readline().split()))


def ls():
    return stdin.readline().split()


def ns():
    return stdin.readline().rstrip()


def lc():
    return list(ns())


def ni():
    return int(stdin.readline())


def nf():
    return float(stdin.readline())


NEXA = 26
dic = {chr(97 + i): i for i in range(NEXA)}
s = lc()
k = ni()
ans = []
for si in s:
    to_nexa = (NEXA - dic[si]) % NEXA
    if to_nexa <= k:
        k -= to_nexa
        ans.append("a")
    else:
        ans.append(si)
if k > 0:
    ans[-1] = chr(97 + (dic[ans[-1]] + k) % NEXA)
print(("".join(ans)))

-# 入力 +sys.setrecursionlimit(10**7) -    return [int(x) for x in stdin.readline().split()] +    return list(map(int, stdin.readline().split())) -    return [float(x) for x in stdin.readline().split()] +    return list(map(float, stdin.readline().split())) -    return int(ns()) +    return int(stdin.readline()) -    return float(ns()) +    return float(stdin.readline()) -# ここから処理 -s = ns() +NEXA = 26 +dic = {chr(97 + i): i for i in range(NEXA)} +s = lc() -chl = list(s) -res = k -for i, c in enumerate(chl): -    if c == "a": -        continue -    elif res >= ord("z") - ord(c) + 1: -        chl[i] = "a" -        res -= ord("z") - ord(c) + 1 -chl[-1] = chr(ord(chl[-1]) + res % 26) -print(("".join(chl))) +ans = [] +for si in s: +    to_nexa = (NEXA - dic[si]) % NEXA +    if to_nexa <= k: +        k -= to_nexa +        ans.append("a") +    else: +        ans.append(si) +if k > 0: +    ans[-1] = chr(97 + (dic[ans[-1]] + k) % NEXA) +print(("".join(ans)))