n = int(eval(input()))

s = eval(input())

ns =''

for i in range(len(s)):

    if ord(s[i]) + n < 91:

        ns += chr(ord(s[i]) + n)

    else:

        ns += chr(ord(s[i]) + n - 26)

print(ns)
n = int(eval(input()))

s = eval(input())

ns =''

for i in range(len(s)):

    ns += chr((ord(s[i]) - 65 + n) % 26 + 65)

print(ns)
n = int(eval(input()))
s = eval(input())
ns = ""
for i in range(len(s)):
    if ord(s[i]) + n < 91:
        ns += chr(ord(s[i]) + n)
    else:
        ns += chr(ord(s[i]) + n - 26)
print(ns)

n = int(eval(input()))
s = eval(input())
ns = ""
for i in range(len(s)):
    ns += chr((ord(s[i]) - 65 + n) % 26 + 65)
print(ns)

-    if ord(s[i]) + n < 91: -        ns += chr(ord(s[i]) + n) -    else: -        ns += chr(ord(s[i]) + n - 26) +    ns += chr((ord(s[i]) - 65 + n) % 26 + 65)