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

import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll



alpha = "abcdefghijklmnopqrstuvwxyz"



s = input()

K = int(input())

dic = dict([alpha[i], i] for i in range(len(alpha)))



ans = [] 

for si in s:

    d = 26 - dic[si] if si != "a" else 0

    if d <= K:

        ans.append("a")

        K -= d

    else:

        ans.append(si)



if K > 0:

    ans[-1] = alpha[(dic[ans[-1]] + K) % 26]



print("".join(ans))

s = list(input())

K = int(input())

for i in range(len(s)):

  if s[i] == 'a': continue

  d = ord('z') - ord(s[i]) + 1

  if K >= d:

    s[i] = 'a'

    K -= d

    

K %= 26

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

  

print("".join(s))
# -*- coding: utf-8 -*-
import sys, copy, math, heapq, itertools as it, fractions, re, bisect, collections as coll

alpha = "abcdefghijklmnopqrstuvwxyz"
s = input()
K = int(input())
dic = dict([alpha[i], i] for i in range(len(alpha)))
ans = []
for si in s:
    d = 26 - dic[si] if si != "a" else 0
    if d <= K:
        ans.append("a")
        K -= d
    else:
        ans.append(si)
if K > 0:
    ans[-1] = alpha[(dic[ans[-1]] + K) % 26]
print("".join(ans))

s = list(input())
K = int(input())
for i in range(len(s)):
    if s[i] == "a":
        continue
    d = ord("z") - ord(s[i]) + 1
    if K >= d:
        s[i] = "a"
        K -= d
K %= 26
s[-1] = chr((ord(s[-1]) - ord("a") + K) % 26 + ord("a"))
print("".join(s))

-# -*- coding: utf-8 -*- -import sys, copy, math, heapq, itertools as it, fractions, re, bisect, collections as coll - -alpha = "abcdefghijklmnopqrstuvwxyz" -s = input() +s = list(input()) -dic = dict([alpha[i], i] for i in range(len(alpha))) -ans = [] -for si in s: -    d = 26 - dic[si] if si != "a" else 0 -    if d <= K: -        ans.append("a") +for i in range(len(s)): +    if s[i] == "a": +        continue +    d = ord("z") - ord(s[i]) + 1 +    if K >= d: +        s[i] = "a" -    else: -        ans.append(si) -if K > 0: -    ans[-1] = alpha[(dic[ans[-1]] + K) % 26] -print("".join(ans)) +K %= 26 +s[-1] = chr((ord(s[-1]) - ord("a") + K) % 26 + ord("a")) +print("".join(s))