# code-festival-2016-qualaC - 次のアルファベット / Next Letter

from string import ascii_lowercase as abc





def main():

    S = input().rstrip()

    K = int(eval(input()))

    # dist[c] := distance to "a" through "z"

    dist = {c: 26 - i for i, c in enumerate(abc)}

    dist["a"] = 0

    A = [dist[i] for i in S]

    ans = ""

    for i, s in zip(A[:-1], S[:-1]):

        if 0 < i <= K:  # change s to "a" if possible

            ans += "a"

            K -= i

        else:

            ans += s

    # use the remaining K on A[-1] and combine with ans

    ans += chr((ord(S[-1]) + K - ord("a")) % 26 + ord("a"))

    print(ans)





if __name__ == "__main__":

    main()
# code-festival-2016-qualaC - 次のアルファベット / Next Letter

def main():

    S = input().rstrip()

    K = int(eval(input()))

    abc = "abcdefghijklmnopqrstuvwxyz"

    # dist[c] := distance to "a" through "z"

    dist = {c: 26 - i for i, c in enumerate(abc)}

    dist["a"] = 0

    A = [dist[i] for i in S]

    ans = ""

    for i, s in zip(A[:-1], S[:-1]):

        if 0 < i <= K:  # change s to "a" if possible

            ans += "a"

            K -= i

        else:

            ans += s

    # use the remaining K on A[-1] and combine with ans

    ans += chr((ord(S[-1]) + K - ord("a")) % 26 + ord("a"))

    print(ans)





if __name__ == "__main__":

    main()
# code-festival-2016-qualaC - 次のアルファベット / Next Letter
from string import ascii_lowercase as abc


def main():
    S = input().rstrip()
    K = int(eval(input()))
    # dist[c] := distance to "a" through "z"
    dist = {c: 26 - i for i, c in enumerate(abc)}
    dist["a"] = 0
    A = [dist[i] for i in S]
    ans = ""
    for i, s in zip(A[:-1], S[:-1]):
        if 0 < i <= K:  # change s to "a" if possible
            ans += "a"
            K -= i
        else:
            ans += s
    # use the remaining K on A[-1] and combine with ans
    ans += chr((ord(S[-1]) + K - ord("a")) % 26 + ord("a"))
    print(ans)


if __name__ == "__main__":
    main()

# code-festival-2016-qualaC - 次のアルファベット / Next Letter
def main():
    S = input().rstrip()
    K = int(eval(input()))
    abc = "abcdefghijklmnopqrstuvwxyz"
    # dist[c] := distance to "a" through "z"
    dist = {c: 26 - i for i, c in enumerate(abc)}
    dist["a"] = 0
    A = [dist[i] for i in S]
    ans = ""
    for i, s in zip(A[:-1], S[:-1]):
        if 0 < i <= K:  # change s to "a" if possible
            ans += "a"
            K -= i
        else:
            ans += s
    # use the remaining K on A[-1] and combine with ans
    ans += chr((ord(S[-1]) + K - ord("a")) % 26 + ord("a"))
    print(ans)


if __name__ == "__main__":
    main()

-from string import ascii_lowercase as abc - - +    abc = "abcdefghijklmnopqrstuvwxyz"