def convert(S): c = "CpCzNkSuTbEoA" t = "" for s in S: if s == "z": t += "a" elif s == "Z": t += "A" elif s == "9": t += c else: t += chr(ord(s)+1) return t S = list(input()) n = int(input()) if n >= 36: n = 10 + (n - 10) % 26 for i in range(n): S = convert(S) print(S)