l = [chr(i) for i in range(97, 97+26)] l2 = [chr(i) for i in range(65,65+26)] def f(s,n):#sをn回変える S = list(s) for i in range(len(S)): try: S[i] = int(S[i]) #整数チェック #整数なら if S[i]+n > 9: S[i] = f("CpCzNkSuTbEoA",n-10) else: S[i] = str(S[i]+n) except: #文字列なら try: l.index(S[i]) #小文字チェック #小文字なら S[i] = l[(l.index(S[i])+n)%26] except: #大文字なら S[i] = l2[(l2.index(S[i])+n)%26] return "".join(S) S = input() N = int(input()) print(f(S,N))