ls=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

N=26-int(eval(input()))

S=eval(input())

ans=[]

for i in range(len(S)):

  x=ls.index(S[i])

  ans.append(ls[x-N])

print(("".join(ans)))
ls=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

N=int(eval(input()))

S=eval(input())

ans=[ls[(ls.index(S[i])+N)%26] for i in range(len(S))]

print(("".join(ans)))
ls = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = 26 - int(eval(input()))
S = eval(input())
ans = []
for i in range(len(S)):
    x = ls.index(S[i])
    ans.append(ls[x - N])
print(("".join(ans)))

ls = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(eval(input()))
S = eval(input())
ans = [ls[(ls.index(S[i]) + N) % 26] for i in range(len(S))]
print(("".join(ans)))

-N = 26 - int(eval(input())) +N = int(eval(input())) -ans = [] -for i in range(len(S)): -    x = ls.index(S[i]) -    ans.append(ls[x - N]) +ans = [ls[(ls.index(S[i]) + N) % 26] for i in range(len(S))]