import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2, log

from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from bisect import bisect, bisect_left, insort, insort_left

from fractions import gcd

from heapq import heappush, heappop

from functools import reduce

from decimal import Decimal

def input(): return sys.stdin.readline().strip()

def INT(): return int(input())

def MAP(): return map(int, input().split())

def LIST(): return list(map(int, input().split()))

def ZIP(n): return zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

mod = 10**9 + 7

from decimal import *



s = list(input())

K = INT()



for i in range(len(s)):

	tmp = 26 - ascii_lowercase.index(s[i])

	if tmp <= K and tmp < 26:

		K -= tmp

		s[i] = "a"



idx = ascii_lowercase.index(s[-1])

s[-1] = ascii_lowercase[(idx+K)%26]



print(*s, sep="")

import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2, log

from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from bisect import bisect, bisect_left, insort, insort_left

from fractions import gcd

from heapq import heappush, heappop

from functools import reduce

from decimal import Decimal

def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

def MAP(): return list(map(int, input().split()))

def LIST(): return list(map(int, input().split()))

def ZIP(n): return list(zip(*(MAP() for _ in range(n))))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

mod = 10**9 + 7

from decimal import *



s = list(eval(input()))

K = INT()



def ctoi(c):

	return ord(c)-ord("a")



for i in range(len(s)):

	x = ctoi(s[i])

	if x == 0 or 26-x > K:

		continue

	K -= 26 - x

	s[i] = "a"



if K:

	s[-1] = ascii_lowercase[(ctoi(s[-1])+K)%26]



print(("".join(s)))
import sys, re
from collections import deque, defaultdict, Counter
from math import (
    ceil,
    sqrt,
    hypot,
    factorial,
    pi,
    sin,
    cos,
    tan,
    asin,
    acos,
    atan,
    radians,
    degrees,
)  # , log2, log
from itertools import (
    accumulate,
    permutations,
    combinations,
    combinations_with_replacement,
    product,
    groupby,
)
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(input())


def MAP():
    return map(int, input().split())


def LIST():
    return list(map(int, input().split()))


def ZIP(n):
    return zip(*(MAP() for _ in range(n)))


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

s = list(input())
K = INT()
for i in range(len(s)):
    tmp = 26 - ascii_lowercase.index(s[i])
    if tmp <= K and tmp < 26:
        K -= tmp
        s[i] = "a"
idx = ascii_lowercase.index(s[-1])
s[-1] = ascii_lowercase[(idx + K) % 26]
print(*s, sep="")

import sys, re
from collections import deque, defaultdict, Counter
from math import (
    ceil,
    sqrt,
    hypot,
    factorial,
    pi,
    sin,
    cos,
    tan,
    asin,
    acos,
    atan,
    radians,
    degrees,
)  # , log2, log
from itertools import (
    accumulate,
    permutations,
    combinations,
    combinations_with_replacement,
    product,
    groupby,
)
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


def MAP():
    return list(map(int, input().split()))


def LIST():
    return list(map(int, input().split()))


def ZIP(n):
    return list(zip(*(MAP() for _ in range(n))))


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

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


def ctoi(c):
    return ord(c) - ord("a")


for i in range(len(s)):
    x = ctoi(s[i])
    if x == 0 or 26 - x > K:
        continue
    K -= 26 - x
    s[i] = "a"
if K:
    s[-1] = ascii_lowercase[(ctoi(s[-1]) + K) % 26]
print(("".join(s)))

-    return int(input()) +    return int(eval(input())) -    return map(int, input().split()) +    return list(map(int, input().split())) -    return zip(*(MAP() for _ in range(n))) +    return list(zip(*(MAP() for _ in range(n)))) -s = list(input()) +s = list(eval(input())) + + +def ctoi(c): +    return ord(c) - ord("a") + + -    tmp = 26 - ascii_lowercase.index(s[i]) -    if tmp <= K and tmp < 26: -        K -= tmp -        s[i] = "a" -idx = ascii_lowercase.index(s[-1]) -s[-1] = ascii_lowercase[(idx + K) % 26] -print(*s, sep="") +    x = ctoi(s[i]) +    if x == 0 or 26 - x > K: +        continue +    K -= 26 - x +    s[i] = "a" +if K: +    s[-1] = ascii_lowercase[(ctoi(s[-1]) + K) % 26] +print(("".join(s)))