N = int(eval(input()))

S = input().strip()

x = ""

for i in range(len(S)):

    a = ord(S[i])+N

    if a<=90:

        x += chr(a)

    else:

        x += chr(a-26)

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

S = input().strip()

N = N%26

x = ""

for i in range(len(S)):

    k = ord(S[i])

    j = (k-65+N)%26+65

    x += chr(j)

print(x)
N = int(eval(input()))
S = input().strip()
x = ""
for i in range(len(S)):
    a = ord(S[i]) + N
    if a <= 90:
        x += chr(a)
    else:
        x += chr(a - 26)
print(x)

N = int(eval(input()))
S = input().strip()
N = N % 26
x = ""
for i in range(len(S)):
    k = ord(S[i])
    j = (k - 65 + N) % 26 + 65
    x += chr(j)
print(x)

+N = N % 26 -    a = ord(S[i]) + N -    if a <= 90: -        x += chr(a) -    else: -        x += chr(a - 26) +    k = ord(S[i]) +    j = (k - 65 + N) % 26 + 65 +    x += chr(j)