import sys input = sys.stdin.readline from collections import * def forward(s): if '0'<=s<'9': return str((int(s)+1)) elif s=='9': return 'CpCzNkSuTbEoA' elif 'a'<=s<='z': return chr((ord(s)-ord('a')+1)%26+ord('a')) else: return chr((ord(s)-ord('A')+1)%26+ord('A')) S = input()[:-1] N = int(input()) for _ in range(min(15, N)): T = [] for i in range(len(S)): T.append(forward(S[i])) S = ''.join(T) if N>15: S = list(S) for i in range(len(S)): for j in range((N-15)%26): S[i] = forward(S[i]) print(''.join(S))