N = int(eval(input()))

S = eval(input())

A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

ans = ''

for i in range(len(S)):

    for j in range(len(A)):

        if S[i] == A[j]:

            ans += A[j+N]

            break

print(ans)
N = int(eval(input()))

S = eval(input())

ans = ''

for i in range(len(S)):

    if ord(S[i])+N <= ord('Z'):

        ans += chr(ord(S[i])+N)

    else:

        ans +=chr(ord(S[i])+N-26)

print(ans)
N = int(eval(input()))
S = eval(input())
A = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in range(len(S)):
    for j in range(len(A)):
        if S[i] == A[j]:
            ans += A[j + N]
            break
print(ans)

N = int(eval(input()))
S = eval(input())
ans = ""
for i in range(len(S)):
    if ord(S[i]) + N <= ord("Z"):
        ans += chr(ord(S[i]) + N)
    else:
        ans += chr(ord(S[i]) + N - 26)
print(ans)

-A = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" -    for j in range(len(A)): -        if S[i] == A[j]: -            ans += A[j + N] -            break +    if ord(S[i]) + N <= ord("Z"): +        ans += chr(ord(S[i]) + N) +    else: +        ans += chr(ord(S[i]) + N - 26)