# -*- coding: utf-8 -*-

"""

C - 次のアルファベット / Next Letter

https://atcoder.jp/contests/code-festival-2016-quala/tasks/codefestival_2016_qualA_c



"""

import sys



from string import ascii_lowercase



def solve(s, K):

    ans = []

    for ch in s:

        distance = ascii_lowercase[::-1].index(ch) + 1

        if distance <= K and ch != 'a':

            K -= distance

            ans.append('a')

        else:

            ans.append(ch)

    ans[-1] = ascii_lowercase[(ord(ans[-1]) - ord('a') + K) % 26]

    return ''.join(ans)





def main(args):

    s = eval(input())

    K = int(eval(input()))

    ans = solve(s, K)

    print(ans)





if __name__ == '__main__':

    main(sys.argv[1:])

# -*- coding: utf-8 -*-

"""

C - 次のアルファベット / Next Letter

https://atcoder.jp/contests/code-festival-2016-quala/tasks/codefestival_2016_qualA_c



"""

import sys



from string import ascii_lowercase



def solve(s, K):

    ans = []

    lut = 'a' + ascii_lowercase[::-1]

    for ch in s:

        distance = lut.index(ch)

        if distance <= K:

            K -= distance

            ans.append('a')

        else:

            ans.append(ch)

    ans[-1] = ascii_lowercase[(ord(ans[-1]) - ord('a') + K) % 26]

    return ''.join(ans)





def main(args):

    s = eval(input())

    K = int(eval(input()))

    ans = solve(s, K)

    print(ans)





if __name__ == '__main__':

    main(sys.argv[1:])

# -*- coding: utf-8 -*-
"""
C - 次のアルファベット / Next Letter
https://atcoder.jp/contests/code-festival-2016-quala/tasks/codefestival_2016_qualA_c
"""
import sys
from string import ascii_lowercase


def solve(s, K):
    ans = []
    for ch in s:
        distance = ascii_lowercase[::-1].index(ch) + 1
        if distance <= K and ch != "a":
            K -= distance
            ans.append("a")
        else:
            ans.append(ch)
    ans[-1] = ascii_lowercase[(ord(ans[-1]) - ord("a") + K) % 26]
    return "".join(ans)


def main(args):
    s = eval(input())
    K = int(eval(input()))
    ans = solve(s, K)
    print(ans)


if __name__ == "__main__":
    main(sys.argv[1:])

# -*- coding: utf-8 -*-
"""
C - 次のアルファベット / Next Letter
https://atcoder.jp/contests/code-festival-2016-quala/tasks/codefestival_2016_qualA_c
"""
import sys
from string import ascii_lowercase


def solve(s, K):
    ans = []
    lut = "a" + ascii_lowercase[::-1]
    for ch in s:
        distance = lut.index(ch)
        if distance <= K:
            K -= distance
            ans.append("a")
        else:
            ans.append(ch)
    ans[-1] = ascii_lowercase[(ord(ans[-1]) - ord("a") + K) % 26]
    return "".join(ans)


def main(args):
    s = eval(input())
    K = int(eval(input()))
    ans = solve(s, K)
    print(ans)


if __name__ == "__main__":
    main(sys.argv[1:])

+    lut = "a" + ascii_lowercase[::-1] -        distance = ascii_lowercase[::-1].index(ch) + 1 -        if distance <= K and ch != "a": +        distance = lut.index(ch) +        if distance <= K: