Problem:
 Score : 200 points    Problem Statement We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that A follows Z . For example, shifting A by 2 results in C ( A  \to  B  \to  C ), and shifting Y by 3 results in B ( Y  \to  Z  \to  A  \to  B ).      Constraints  0 \leq N \leq 26  1 \leq |S| \leq 10^4  S consists of uppercase English letters.         Input Input is given from Standard Input in the following format:  N  S       Output Print the string resulting from shifting each character of S by N in alphabetical order.        Sample Input 1 2
ABCXYZ      Sample Output 1 CDEZAB  Note that A follows Z .       Sample Input 2 0
ABCXYZ      Sample Output 2 ABCXYZ       Sample Input 3 13
ABCDEFGHIJKLMNOPQRSTUVWXYZ      Sample Output 3 NOPQRSTUVWXYZABCDEFGHIJKLM

Solution (Python):
N = int(input())
S = input()
alf = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

out = []
for i in range(len(S)):
    for j in range(26):
        if S[i] == alf[j]:
            k = (j + N) % 26
            out.append(alf[k])

print("".join(out))

Solution (Python):
s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
sin = input()
ans = ''
for char in sin:
  for i in range(len(s)):
    if char == s[i]:
      ans += s[-(-(i+n)%len(s))]
print(ans)

Solution (Python):

n = int(input())
chars = list(input())

for i, c in enumerate(chars):
    code = ord(c)+n
    if code >90:
        chars[i] = chr(ord(c)+n-26)
    else:
        chars[i] = chr(ord(c)+n)
print("".join(chars))

Solution (Python):
n = int(input())
s = input()
for i in s:
    x = ord(i) + n
    if x <= 90:
        print(chr(x), end='')
    else:
        print(chr(x+6).upper(), end='')

Solution (Python):

N = int(input())
S = list(input())




def chr_change(chr, N):
    """ print("chr is", chr)
    print("N is", N)
    print("ord(chr) is ", ord(chr))
     """
    Num_AtoZ = ord("Z") - ord("A")
    if ord(chr) + N > ord("Z"):
        chg_chr = ord(chr) + N - Num_AtoZ -1
    else:
        chg_chr = ord(chr) + N
    
    return chg_chr


for i in range(len(S)):
    tmp_chr = S[i]
    print(chr(chr_change(tmp_chr, N)), end = "")
print("\n")

Solution (Python):
n=int(input())
S=input()

def forward(s, n):
  A_id = ord('A')
  num_AtoZ = ord('Z') - ord('A') + 1
  return chr(A_id + (ord(s) - A_id + n) % (num_AtoZ))

print(''.join([forward(s, n) for s in S]))

Solution (Python):
alp_tot = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

alp_to_num = {}
num_to_alp = {}
for num, alp in enumerate(alp_tot):
    alp_to_num[alp] = num
    num_to_alp[num] = alp

n = int(input())
row = input()

ans = ''
for alp in row:
    num = (alp_to_num[alp] + n) % (len(alp_tot))
    ans += num_to_alp[num]

print(ans)

Solution (Python):
s = int(input())
n = input()
ans = [0]*len(n)
for index,i in enumerate(n):
  k = ord(i)+s
  if k <= 90:
    ans[index]=chr(k)
  else:
    ans[index]=chr(k%90+64)
print(''.join(map(str,ans)))

Solution (Python):
n=int(input())
s=input()
a="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans =""
for i in range(len(s)):
    for j in range(26):
        if s[i] == a[j]:
            ans += a[j+n]
            
print(ans)

Solution (Python):
N = int(input())
S = str(input())
ans = [0] * len(S)

alpha2num = lambda c: ord(c) - ord('A') + 1
num2alpha = lambda c: chr(c+64)

for i in range(len(S)):
  alpha = S[i]
  num = alpha2num(alpha)
  num += N
  if num > 26:
    num -= 26
  ans[i] = num2alpha(num)

for i in range(len(S)):
  print(ans[i], end = "")

Solution (Python):
n=int(input())
s=input()

for i in range(len(s)):
    a=ord(s[i])+n
    if a > 90:
        a = a - 26
  
    print(chr(a),end='')

Solution (Python):
n = int(input())
s = input()

changed = ""
for char in s:
    k = ord(char)
    if k + n > 90:
        changed += chr(k + n - 26)
    else:
        changed += chr(k + n)

print(changed)

Solution (Python):
n=int(input())
s=input()
t=str()
for i in range(len(s)):
  if (ord(s[i])-64+n)%26!=0:
    t+=chr(((ord(s[i])-64+n)%26)+64)
  else:
    t+=chr(90)
print(t)

Solution (Python):
N = int(input())
S = input()
ans = ""
base = ord("A")
for s in S:
    ind = (ord(s) - base + N)%26 + base
    ans += chr(ind)
print(ans)

Solution (Python):
import sys
import string
input = sys.stdin.readline

N = int(input())
S = input().strip()
abc = [i for i in string.ascii_uppercase]
ans = ""

for letter in S:
    indx = abc.index(letter) + 1
    nxt = indx + N
    if nxt <= 26:
        ans += abc[nxt - 1]
    else:
        ans += abc[nxt % 26 - 1]
print(ans)

Solution (Python):
N = int(input())
S = input()

M = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
print(''.join([M[(M.index(s) + N) % len(M)] for s in S]))

Solution (Python):
n = int(input())
s = input()
ans = []
for i in s:
    x = ord(i)
    if x+n>90:
        ans.append(chr(x+n-26))
    else:
        ans.append(chr(x+n))
print(''.join(ans))

Solution (Python):
alph_list= ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
N = int(input())
S = input("")
ans = str()
for i in range(len(S)):
    t = alph_list.index(S[i]) + N
    if t < len(alph_list):
        ans += alph_list[t]
    else:
        ans += alph_list[t - len(alph_list)]
print(ans)

Solution (Python):
import string

N = int(input())
S = input()
chars = string.ascii_uppercase
print(''.join(chars[(chars.index(c) + N) % 26] for c in S))

Solution (Python):

Alphabet_List = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S_1 = list(input())
S_2 = []

for i in range(len(S_1)):
    S_2.append(Alphabet_List.index(S_1[i]))
    S_2[i] = (S_2[i] + N) % 26
    S_2[i] = Alphabet_List[S_2[i]]

S_3 = "".join(S_2)
print(S_3)

Solution (Python):
n = int(input())
s = input()
for o in s:
    print(chr((ord(o)+n-ord('A'))%26+ord('A')),end="")
print()

Solution (Python):
n=int(input())
s=input()
alpha2num=lambda c: ord(c) - ord("A")+1
num2alpha=lambda c: chr(c+64)

char=list(s)
for i in range(len(char)):
	alphabet=alpha2num(char[i])+n
	
	if alphabet>26:
		numalpha=num2alpha(alphabet-26)
	else:
		numalpha=num2alpha(alphabet)
	
	char[i]=numalpha

mapchar=map(str,char)
ret="".join(char)
print(ret)

Solution (Python):
n = int(input())
s = input()
 
l = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
out = ""
 
for c in s:
    out += l[(l.index(c)+n)%26]
 
print(out)

Solution (Python):
n = int(input())
s = input()

l = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

out = ""

for c in s:
    out += l[(l.index(c)+n)%26]

print(out)

Solution (Python):
a = int(input())
str = input()
for i in range(len(str)):
  val = ord(str[i])+a 
  if val > 90:
   	  val -=26   
  print(chr(val),end="")

Solution (Python):
N = int(input())
S = list(input())
a = ord('A')
for i in range(len(S)):
    char = (ord(S[i]) - a + N) % 26
    S[i] = chr(a + char)
print(''.join(S))

Solution (Python):
N = int(input())
S = input()

newS = ""
for s in S.lower():
    s_to_num = ord(s) - 96
    if (s_to_num + N) % 26 != 0:
        new_s = chr( ( (s_to_num + N) % 26 ) + 96)
    else:
        new_s = chr( 26 + 96)
    newS += new_s
print(newS.upper())

Solution (Python):
n= int(input())
s = input()



ans = ""
for i in range(len(s)):
    chr_num = ord(s[i]) + n
    if chr_num > 90:
        chr_num = (chr_num % 90) + 64
    ans += chr(chr_num)
print(ans)

Solution (Python):
n = int(input())
s = input()
s = list(s)
alfa = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
for i in range(len(s)):
    s[i] = alfa[(alfa.index(s[i])+n)%len(alfa)]
ans = ""
for i in range(len(s)):
    ans += s[i] 
print(ans)

Solution (Python):
import string
n = input()
s = input()
list = list(string.ascii_uppercase)
list.extend(list)
newlist = []
for al in s:
  initloc = list.index(al)
  nowloc = int(initloc) + int(n)
  
  newlist.append(list[nowloc])
print("".join(newlist))

Solution (Python):
N = int(input())
S = input()
L = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
S = list(S)
ANS = []

for n in range(len(S)):
    new_n =(L.index(S[n]) + N)  % 26
    ANS.append(L[new_n])

print(''.join(ANS))

Solution (Python):
n=int(input())
s=str(input())
s1=''
alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in s:
  s1+=alpha[ord(i)-65+n]
print(s1)

Solution (Python):
N = int(input())
S = input()
ans = ""
for c in S :
    a = ord(c) - ord('A')
    a += N
    a %= 26
    ans += chr(ord('A') + a)
print(ans)

Solution (Python):
n = int(input())
s = input()

for i in range(len(s)):
    a = ord(s[i])+n
    if a>90:
        print(chr(a-26),end='')
    else:
        print(chr(a),end='')

Solution (Python):


alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

n = int(input())
s = input()

s_shift_n = ''
for i in range(len(s)):
    s_shift_n += alphabet[(alphabet.index(s[i])+n)%26]

print(s_shift_n)

Solution (Python):
N = int(input())
res = ""

for i in list(input()):
    ascii = ord(i)
    n = ascii - 65
    n = (n + N) % 26
    res += chr(n + 65)
print(res)

Solution (Python):
N = int(input())
S = list(input())
"""
ans = ""
for a in S:
    ans += chr((ord(a) + N - ord("A")) % 26 + ord("A"))

"""
ans = ""
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for a in S:
    ans += alpha[(alpha.index(a) + N) % 26]

print(ans)

Solution (Python):
N = int(input())
S = list(input())

ans = ""
for a in S:
    ans += chr((ord(a) + N - ord("A")) % 26 + ord("A"))

print(ans)

Solution (Python):
alphaList = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
i = int(input())
str = input()
out = ""
for s in str :
    out = out + alphaList[(alphaList.index(s) + i) % 26]
print(out)

Solution (Python):
N = int(input())
s = str(input())
"""l = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
ans = ""
for i in range(len(s)):
    ans+= l[(l.index(s[i])+N)%26]
print(ans)"""
ans = ""
for i in range(len(s)):
    ans += chr((ord(s[i]) - ord('A') + N) % 26 + ord('A'))
print(ans)

Solution (Python):



def main():
    from string import ascii_uppercase

    n = int(input())
    s = input()
    alpha = ascii_uppercase
    ans = ''

    for si in s:
        for index, a in enumerate(alpha):
            if si == a:
                next_index = (index + n) % 26
                ans += alpha[next_index]

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
s = list(input())
for i in range(len(s)):
  c = (ord(s[i]) + n - ord('A')) % 26
  c += ord('A')
  s[i] = chr(c)
print("".join(s))

Solution (Python):
N = int(input())
S = list(input())
ans = ""
A = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
for i in range(len(S)):
    for k in range(26):
        if S[i] == A[k]:
            if k+N < 26:
                ans += A[k+N]
            else:
                ans += A[k+N-26]
print(ans)

Solution (Python):


n = int(input())
s = input()

for c in s:
    nc = ord(c) + n
    if nc > 90:
        nc -= 26
    print(chr(nc), end="")

Solution (Python):
n = int(input())
s = input()

w_n = n % 26

print("".join([chr(65 + (ord(w) - 65 + w_n) % 26) for w in s]))

Solution (Python):
n=int(input())
s=input()
for c in s:
  print(chr((ord(c)-ord('A')+n)%26+ord('A')),end="")

Solution (Python):
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
alphabet += alphabet
n = int(input())
s = list(input())
res = "".join([alphabet[alphabet.index(_) + n] for _ in s])
print(res)

Solution (Python):
n = int(input())
s = input()
dic = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
s_ = ''
for c in s:
  i = dic.index(c)
  j = (i + n) % 26
  s_ += dic[j]
print(s_)

Solution (Python):
S='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
T=''
N=int(input())
U=input()
for i in U:
    T+=S[S.index(i)+N]
print(T)

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

Solution (Python):
c=[chr(i) for i in range(65,65+26)]

n=int(input())
s=input()
for i in range(len(s)):
    if c.index(s[i])+n<26:
        print(c[c.index(s[i])+n],end="")
    else:
        print(c[c.index(s[i])+n-26],end="")
print()

Solution (Python):
N = int(input())
S = list(input())

S_len = len(S)
for i in range(S_len):
    tmp = ord(S[i]) + N
    if tmp > ord("Z"):
        tmp -= 26
    S[i] = chr(tmp)

print("".join(S))

Solution (Python):
N = int(input())
s = str(input())
l = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
ans = ""
for i in range(len(s)):
    ans+= l[(l.index(s[i])+N)%26]
print(ans)

Solution (Python):
N = int(input())
S = input()
ans = ''

for i in range(len(S)):
    c = ord(S[i]) + N
    if c > 90:
        c -= 26
    ans += chr(c)

print(ans)

Solution (Python):
N = int(input())
S = input()
ans = ''
for i in range(len(S)):
  R = N
  if ord(S[i]) + N > 90:
    R = N - 26
  ans = ans + chr(ord(S[i]) + R)
print(ans)

Solution (Python):
ls = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
n = int(input())
s = input()
ans = ""

for i in range(len(s)):
  ans += ls[(ls.index(s[i])+n)%26]
  
print(ans)

Solution (Python):
import string
from sys import stdin
N = int(stdin.readline().rstrip())
S = list(stdin.readline().rstrip())
alpha = list(string.ascii_uppercase)
dic = {c:i for i, c in enumerate(alpha)}
ans = []
for c in S:
  idx = dic[c]+N
  if idx >= 26:
    idx -= 26
  ans.append(alpha[idx])
print(''.join(ans))

Solution (Python):
import string
from sys import stdin
N = int(stdin.readline().rstrip())
S = list(stdin.readline().rstrip())
alpha = list(string.ascii_uppercase)
dic = {c:i for i, c in enumerate(alpha)}
ans = []
for c in S:
  idx = dic[c]+N
  if idx >= 26:
    idx -= 26
  ans.append(alpha[idx])
print(''.join(ans))

Solution (Python):
import string
from sys import stdin
N = int(stdin.readline().rstrip())
S = list(stdin.readline().rstrip())
alpha = list(string.ascii_uppercase)
dic = {c:i for i, c in enumerate(alpha)}
ans = []
for c in S:
  idx = dic[c]+N
  if idx >= 26:
    idx -= 26
  ans.append(alpha[idx])
print(''.join(ans))

Solution (Python):
n = int(input())
l = list(input())

for i in range(len(l)):
    t = ord(l[i])+n
    if t<91:
        l[i] = chr(t)
    else:
        l[i] = chr(t-26)

print("".join(l))

Solution (Python):
N = int(input())
S = input()
ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"

ans = ""
for i in range(len(S)):
    for j in range(len(ALPHA)):
        if S[i] == ALPHA[j]:
            ans += ALPHA[j+N]
            break

print(ans)

Solution (Python):
n = input()
s = input()
for c in s:
	p = ord('A')+(ord(c)-ord('A')+int(n))%26
	print(chr(p), end = "")
print()

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input()) % 26
S = input().rstrip()
ordA = ord("A")

res = ""
for s in S:
    res += chr(ordA + (ord(s) - ordA + N) % 26)

print(res)

Solution (Python):
N = int(input())
S = input()

ans = []

for i in range(len(S)):
    tmp = (ord(S[i]) - 65 + N) % 26 + 65
    ans.append(chr(tmp))

print("".join(ans))

Solution (Python):
import copy
import heapq
import math

def j(n):
    if n:print("Yes")
    else:print("No")
    exit(0)
rem = 10 ** 9 + 7

"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def ipmultiplerow(n):
    a = []
    for i in range(n):
        a.append(ip())
    return a
def printrow(a):
    for i in a:
        print(i)

n = ip()
s = input()

let = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(len(s)):
    p = let.index(s[i])
    p+=n
    print(let[p%26],end='')
print()

Solution (Python):


N = int(input())
S = input()

z_ascii = ord('Z')
S_ascii = map(ord, S)
S_ascii_new = []

for i in S_ascii:
    new = i+N
    S_ascii_new.append(new - 26 if new > z_ascii else new)

print(''.join(map(chr, S_ascii_new)))

Solution (Python):

n = int(input())
s = input()
m = len(s)

for i in range(m):
    print(chr((ord(s[i]) + n - 65) % 26 + 65), end="")
print("")

Solution (Python):
n=int(input())
s=input()
c=""
w=0
for i in s:
  w=ord(i)+n
  if w>ord("Z"):
    w=w-ord("Z")-1+ord("A")
  c+=chr(w)
  
print(c)

Solution (Python):

N = int(input())
s = list(input())
ans = ""
for i in s:
	ans +=chr(((ord(i)-65)+N)%26+ 65)
	
print(ans)

Solution (Python):
def main():
    N = int(input())
    S = input()
    ans = []
    A = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
    for i in S:
        for j in range(27):
            if i == A[j]:
                j += N
                if j >= 26:
                    j -= 26
                ans.append(A[j])
                break
    for i in range(len(ans)):
        print(ans[i], end="")
    print()


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
S =list(input())

list_abc = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

list_ans =[]

for i in range(len(S)):
    if (list_abc.index(S[i])+N) > 25:
        list_ans.append(list_abc[list_abc.index(S[i])+N-26])
    else:
        list_ans.append(list_abc[list_abc.index(S[i])+N])

for i in list_ans:
    print(i,end="")

Solution (Python):
N=int(input())
S=input()
a=list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
for i in range(len(S)):
    print(a[a.index(S[i])+N],end="")

Solution (Python):
n = int(input())
s = input()
t = ""
for i in range(len(s)):
  v = ord(s[i:i+1]) + n
  if(v > 90):
    v -= 26
  t += chr(v)
print(t)

Solution (Python):
n = int(input())
s = input()
h = [0]*(10**5)

k = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

for i in range(len(s)):
  h[i] = k[((k.index(s[i]))+n)%26]

for j in range(len(s)):
  print(h[j],end="")

print(end="")

Solution (Python):
n = int(input())
S = input()

ans = ""
for string in S:
    if ord(string) + n > 90:
        ans += chr(ord(string) + n - 26)
    else:
        ans += chr(ord(string) + n)
print(ans)

Solution (Python):
n=int(input())
s=str(input())
al=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
t=''
for i in range(len(s)):
  x=(al.index(s[i])+n)%26
  t=t+al[x]
print(t)

Solution (Python):
N=int(input())
S=list(input())
P=list()
jia= N%26
for i in range(len(S)):
  xin= ord(S[i])+jia
  if xin > ord("Z"):
   xin-=26
  zimu=chr(xin)
  P+=zimu
p=''.join(P)
print(p)

Solution (Python):
n = int(input())
s = list(input())

list = []
for i in range(len(s)):
  eng = ord(s[i]) + n
  if eng > 90:
    eng = eng - 26
  eng2 = chr(eng)
  list += eng2

l = ''.join(list)
print(l)

Solution (Python):

N = int(input())

add = lambda c: ord(c) - ord("A") + N
cov = lambda c: chr(c+65)

S = list(input())
ans = ""
d = []
for i in range(len(S)):
    a = add(S[i])
    a = a % 26
    a = cov(a)
    ans += a
print(ans)

Solution (Python):
N = int(input())
S = input()
L = [chr(i) for i in range(65, 65+26)]
ans = ''
for i in range(len(S)):
    A = (L.index(S[i])+N) % 26
    ans += L[A]
print(ans)

Solution (Python):
n = int(input())
s = list(input())

abc ="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in s:
    index =abc.index(i)
    new_index = index +n
    if(new_index> 25):
        new_index -= 26
    print(abc[new_index],end='')

Solution (Python):
N = int(input())
S = input()

def rot(s):
    return chr((ord(s) - 65 + N) % 26 + 65)

print("".join([rot(s) for s in S]))

Solution (Python):
import sys
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True  and False

def ddprint(x):
  if DBG:
    print(x)

a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = inn()
n = n%26
b = a[n:] + a[:n]
ddprint(b)
s = input().strip()
for i in range(len(s)):
    for j in range(26):
        if s[i]==a[j]:
            printn(b[j])
            break
print("")

Solution (Python):
n = int(input())
s = input()

ans = ""
for _s in s:
    offset = (ord(_s)-ord("A")+n)%26
    ans += chr(ord("A")+offset)
print(ans)

Solution (Python):
N = int(input())
S = input()
al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(S)):
  x = al.index(S[i])
  y = (x+N)%26
  print(al[y],end='')

Solution (Python):
N = int(input())
S = input()
dic = {'A':0,'B':1,'C':2,'D':3,'E':4,'F':5,
       'G':6,'H':7,'I':8,'J':9,'K':10,'L':11,
       'M':12,'N':13,'O':14,'P':15,'Q':16,'R':17,
       'S':18,'T':19,'U':20,'V':21,'W':22,'X':23,
       'Y':24,'Z':25}

res = ''
for s in S:
    idx = (dic[s]+N) % 26
    keys = [k for k, v in dic.items() if v == idx]
    res += keys[0]


print(res)

Solution (Python):
n=int(input())
hoge=list(input())
huga="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(hoge)):
  print(huga[huga.index(hoge[i])+n],end="")

Solution (Python):
N = int(input())
S = input()

ord_A = ord("A")

print("".join([chr((ord(s)-ord_A+N)%26+ord_A) for s in S]))

Solution (Python):
def caesar(s, n):
    ns = []
    for ch in s:
        
        if ('A' <= ch and ch <= 'Z'):
            ns.append(chr((ord(ch) - ord('A') + n) % 26 + ord('A')))
        
        elif ('a' <= ch and ch <= 'z'):
            ns.append(chr((ord(ch) - ord('a') + n) % 26 + ord('a')))
        
        elif ('0' <= ch and ch <= '9'):
            ns.append(chr((ord(ch) - ord('0') - n) % 10 + ord('0')))
        
        else:
            ns.append(ch)
    return "".join(ns)
a = int(input())
b = input()
result = caesar(b, a)
print(result)

Solution (Python):
N=int(input())
S=input()

A=""
for i in range(len(S)):
  a=((ord(S[i])-64+N)%26) if ((ord(S[i])-64+N)%26) else 26
  A+=chr(a+64)
  
print(A)

Solution (Python):


N = int(input())
S = input()
result = ""
alpha2num = lambda c: ord(c) - ord("A") + 1
num2alpha = lambda c: chr(c+64)

for s in S:
    sum = N+alpha2num(s)
    if sum > 26:
        result += num2alpha(sum - 26)
    else: result += num2alpha(sum)
print(result)

Solution (Python):
import subprocess
import os
import time


import sys
import math
from copy import deepcopy
from collections import deque, defaultdict
from operator import mul
from functools import reduce
sys.setrecursionlimit(20000000)

input = sys.stdin.readline


def main():
    N = int(input())
    S = list(input())[0: -1]

    for i in range(len(S)):
        t = ord(S[i]) + N
        if t > 90:
            t -= 26
        S[i] = chr(t)

    print(''.join(S))

if __name__ == '__main__':
    main()

Solution (Python):
def solve(n, s):
    mapping = {chr(ord("A")+i): chr(ord("A")+(i+n)%26) for i in range(26)}
    return "".join(map(mapping.get, s))

n = int(input())
s = input()
print(solve(n, s))

Solution (Python):
N=int(input())
S=input()
alpha=[chr(ord('A') + i) for i in range(26)]*2
M=[]

for j in range(len(S)):
    index=alpha.index(S[j])
    M.append(alpha[index+N])

print(''.join(M))

Solution (Python):
N = int(input())
S = str(input())
ans = ""

for i in range(len(S)):
  ascii = (ord(S[i]) - ord('A') + N) % 26 + ord('A')
  ans += chr(ascii)
  
print(ans)

Solution (Python):
alphabets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
print( ''.join([alphabets[(alphabets.index(letter)+n)%26] for letter in input()]) )

Solution (Python):
n = int(input())
s = input()
ans = ''
for c in s:
  ans += chr(((ord(c)-ord('A')+n) % 26) + ord('A'))
print(ans)

Solution (Python):
n=int(input())
s=input()
S=""
for i in s:
  S+=chr((ord(i)-65+n)%26+65)
print(S)

Solution (Python):
N = int(raw_input())
S = raw_input()
I = map(ord, S)
I_shifted = map(lambda x: x+N if x+N<91 else x+N-26, I)
print "".join(map(chr, I_shifted))

Solution (Python):


alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

num = int(input())
str = input()
result = ""

for s in str:
  pos = alpha.find(s)
  pos = (pos+num)%len(alpha)
  result += alpha[pos]

print(result)

Solution (Python):
al='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
su=int(input())
moji=input()
ans=''
for i in moji:
  now=al.index(i)
  new=now+su
  if new>25:
    new-=26
  ans+=al[new]
print(ans)

Solution (Python):
n=int(input())
s=input()
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
result = []

for a in s:
  a = alphabet[(alphabet.index(a) + n) % 26]
  result.append(a)

st = "".join(result)
print(st)

Solution (Python):
def main():
    N = int(input())
    S = list(ord(x) - ord('A') for x in input())
    ans = list(chr((N+x)%26 + ord('A')) for x in S)

    print(''.join(ans))

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
s=input()

l=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
ans=[]
for st in s:
  ind=l.index(st)
  new_ind=ind+n
  if new_ind >25:
    new_ind-=26
  ans.append(l[new_ind])
print(*ans,sep="")

Solution (Python):
N=int(input())
S=input()
Sans=""
for ss in S:
    Sans+=chr((ord(ss)-65+N)%26+65)
print(Sans)

Solution (Python):


NUM = int(input())
STRING = input()
A_ASCII = ord('A')

result = ''
for s in STRING:
	result += chr(A_ASCII + (ord(s) + NUM - A_ASCII)%26)

print(result)

Solution (Python):
from collections import deque

def main():
    N = int(input())
    S = deque(input())
    A = ['A','B','C','D','E','F','G','H','I','J','K',
         'L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

    ans = deque()

    while len(S)>0:
        s = S.popleft()
        i = A.index(s)+N
        ans.append(A[i%26])

    print(''.join(ans))

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
S = [(ord(i)-ord("A")+N)%26 for i in input()]
print("".join([chr(i+ord("A")) for i in S]))

Solution (Python):
n=int(input())
s=input()
ans=''
for i in range(len(s)):
	a=ord(s[i])+n
	if a>90:
		a-=26
	ans+=chr(a)
print(ans)

Solution (Python):
def main():
    n = int(input())
    s = input()

    ns = []
    for ch in s:
        ns.append(chr((ord(ch) - ord('A') + n) % 26 + ord('A')))
        
    print("".join(ns))

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
s = list(input())

ans=[]
for i in range(len(s)):
    ord_num = ord(s[i])+n
    if 90 < ord_num:
        ord_num = ord_num-26
    tmp="".join(chr(ord_num))
    ans.append(tmp)
print(*ans,sep="")

Solution (Python):
N = int(input())
S = str(input())

for c in S:
    ans = chr((ord(c) - ord("A") + N)%26 + ord("A"))
    print(ans,end="")

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

Solution (Python):
n = int(input())
s = input()
ans = ""

for c in s:
    iChr = (ord(c)-ord("A")+n)%26
    ans += chr(ord("A")+iChr)
print(ans)

Solution (Python):
n = int(input())
s = input()
alph = ""
for i in range(26):
  alph += chr(65+i)
print(s.translate(str.maketrans(alph, alph[n:] + alph[:n])))

Solution (Python):
N=int(input())
print("".join([chr((ord(s)-65+N)%26+65)for s in input()]))

Solution (Python):
N = int(input())
S = input()
S = "".join([chr((ord(s)-65+N)%26+65) for s in S])
print(S)

Solution (Python):
n = int(input())
s = input()
for i in range(len(s)):
  print(chr(((ord(s[i])+n)%91)%65+65), end = "")

Solution (Python):
N = int(input())
S = input()
order = list(S)

num = len(order)
T = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
aorder = list(T)
aorder[26:26] = aorder

ans = ''
for n in range(num):
    num2 = aorder.index(order[n])
    num3 = num2+N
    aordernum3 = aorder[num3]
    
    ans += aordernum3  
print(ans)

Solution (Python):
N=int(input())
S=list(input())
for i in range(len(S)):
    if (ord(S[i])+N)>90:
        S[i]=chr(ord(S[i])+N-90+64)
    else:
        S[i]=chr(ord(S[i])+N)
for j in range(len(S)):
    print(S[j],sep='',end='')

Solution (Python):
n=int(input())
s=input()
ans=""
for c in s:
    ind = (ord(c)-ord("A")+n)%26
    ans += chr(ord("A")+ind)
print(ans)

Solution (Python):
N = int(input())
S = input()

d = [chr(i) for i in range(65, 91)]

ans = []
for i in range(len(S)):
    ans.append(chr((ord(S[i]) - 65 + N) % 26 + 65))

print("".join(map(str, ans)))

Solution (Python):
N = int(input())
S = list(input())
for i in S:
    print(chr(((ord(i) + N) % 65) % 26 + 65), end="")
print()

Solution (Python):
n = int(input())
s = input()
ans = ""
for i in range(len(s)):
    ind = ord(s[i]) + n
    if ind > 90:
        ind = ind - 26
    ans += chr(ind)
print(ans)

Solution (Python):
import string
n = int(input())
s = list(input())
alphabets = list(string.ascii_uppercase)

for i, v in enumerate(s):
    idx = alphabets.index(v) + n
    if idx >= 26:
        idx -= 26
    s[i] = alphabets[idx]

print(''.join(s))

Solution (Python):
def caesar(s, n):
    ns = []
    for ch in s:
        
        if ('A' <= ch and ch <= 'Z'):
            ns.append(chr((ord(ch) - ord('A') + n) % 26 + ord('A')))
        
        elif ('a' <= ch and ch <= 'z'):
            ns.append(chr((ord(ch) - ord('a') + n) % 26 + ord('a')))
        
        elif ('0' <= ch and ch <= '9'):
            ns.append(chr((ord(ch) - ord('0') + n) % 10 + ord('0')))
        
        else:
            ns.append(ch)
    return "".join(ns)
x = int(input())
y = str(input())
result = caesar(y, x)
print(result)

Solution (Python):
a=('ABCDEFGHIJKLMNOPQRSTUVWXYZ'*2)[int(input()):]
print(''.join([a[ord(c)-65] for c in input()]))

Solution (Python):
def add_alpha(char, add) :
    code = ord(char) + add
    if (code >= 91) :
        code -= 26
    return chr(code)


def main() :
    N = int(input())
    S = input()

    out = ""
    for s in S:
        out += add_alpha(s,N)

    print(out)

main()

Solution (Python):
n = int(input())
s = str(input())

l = [chr(i) for i in range(65,65+26)]*2

alpha_dict = {}
for i,c in enumerate(range(ord('A'),ord('Z')+1)):
    alpha_dict[chr(c)] = i

ans = ''
for i in range(len(s)):
  j = alpha_dict[s[i]]
  ans += l[j+n]
  
print(ans)

Solution (Python):
n = int(input())
s = str(input())

l = [chr(i) for i in range(65,65+26)]*2

alpha_dict = {}
for i,c in enumerate(range(ord('A'),ord('Z')+1)):
    alpha_dict[chr(c)] = i

ans = ''
for i in range(len(s)):
  j = alpha_dict[s[i]]
  ans += l[j+n]
  
print(ans)

Solution (Python):
n = int(input())
s = str(input())
def sc(n,l):
  al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  for i in range(26):
    if l == al[i]:
      return al[(i+n)%26]
for i in range(len(s)):
  print(sc(n,s[i]),end="")

Solution (Python):
l=[chr(ord('A') + i) for i in range(26)]
N=int(input())
S=input()
ans=""

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

Solution (Python):


import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    n = int(input())
    s = input()
    base = ord('A')
    ans = ''
    for c in s:
        code = ord(c) - base
        replaced = chr((code + n) % 26 + base)
        ans += replaced
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
s = input()
ss = ""

for i in range(len(s)):
    a = ord(s[i])+n
    
    if a >=91:
        a = a-26
        ss += chr(a)
    else:
        ss += chr(a)
print(ss)

Solution (Python):
input_number = int(input())
input_str = input()
abc_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
abc_list = abc_list + abc_list
output_str = ""
for i in range(len(input_str)):
    output_str += abc_list[abc_list.index(input_str[i]) + input_number]
print(output_str)

Solution (Python):
N = int(input())
S = input()

ans = ''

for i in range(len(S)):
  ans += chr((ord(S[i]) - ord('A') + N) % 26 + ord('A'))

print(ans)

Solution (Python):
N = input()
S = input()
for i in S:
    if chr(ord(i) + int(N)) > "Z":
        print(chr(ord(i) + int(N) - int(26)), end="")
    else:
        print(chr(ord(i) + int(N)), end="")

Solution (Python):
N=int(input())
S=input()
ans=''
for s in S:
  n=(ord(s)+N-65)%26
  ans+=chr(n+65)
print(ans)