from collections import Counter def extended_rotate(letter: str) -> str: if letter == "z": return "a" if letter == "Z": return "A" if letter == "9": return "CpCzNkSuTbEoA" return chr(ord(letter) + 1) def main(): S = input() N = int(input()) while N > 0: counter_S = Counter(S) if sum(counter_S[str(i)] for i in range(10)): S_tmp = "" for letter in S: S_tmp += extended_rotate(letter) S = S_tmp N -= 1 else: N %= 26 break while N > 0: counter_S = Counter(S) if sum(counter_S[str(i)] for i in range(10)): raise ValueError S_tmp = "" for letter in S: S_tmp += extended_rotate(letter) S = S_tmp N -= 1 print(S) if __name__ == "__main__": main()