def f(c, n): if 'a' <= c <= 'z': return chr(ord('a') + (ord(c) - ord('a') + n % 26) % 26) elif 'A' <= c <= 'Z': return chr(ord('A') + (ord(c) - ord('A') + n % 26) % 26) else: raise ValueError s = input() n = int(input()) result = [] for c in s: if '0' <= c <= '9': m = n + int(c) if m > 9: result.append(''.join([f(c2, m - 10) for c2 in "CpCzNkSuTbEoA"])) else: result.append(str(m)) else: result.append(f(c, n)) print(''.join(result))