n = int(eval(input()))

s = eval(input())

string = ""



for i in range(len(s)):

    if ord(s[i]) + n <= ord("Z"):

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

    else:

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



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

s = eval(input())



ans = ""



for i in range(len(s)):

    ans += chr(ord("A") +(((ord(s[i])+n)-ord("A")) % 26))



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

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

-string = "" +ans = "" -    if ord(s[i]) + n <= ord("Z"): -        string += chr(ord(s[i]) + n) -    else: -        string += chr(ord(s[i]) + n - 26) -print(string) +    ans += chr(ord("A") + (((ord(s[i]) + n) - ord("A")) % 26)) +print(ans)