name = "CpCzNKSuTbEoA" num = "0123456789" lg = [chr(ord("A") + i) for i in range(26)] sm = [chr(ord("a") + i) for i in range(26)] def change(S, n): ret = "" for i in range(len(S)): if S[i] in sm: ret += sm[(sm.index(S[i]) + n) % 26] if S[i] in lg: ret += lg[(lg.index(S[i]) + n) % 26] if S[i] in num: if num.index(S[i]) + n > 9: m = num.index(S[i]) + n - 10 ret += change(name, m) else: ret += num[num.index(S[i]) + n] return ret S = input() N = int(input()) print(change(S, N))