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):
def add_N(S, N):
    code_Z = ord("Z")
    code_A = ord("A")
    code = ord(S) + N
    while code > code_Z:
        code = code - code_Z - 1 + code_A
    return code

N = int(input())
S = input()
length = len(S)

for i in range(0, length):
    print(chr(add_N(S[i], N)), end="")

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

for s in S:
    if ord(s)+N > ord('Z'):
        print(chr(ord(s)+N-26),end='')
    else:
        print(chr(ord(s)+N),end='')

Solution (Python):
import string
A = list(string.ascii_uppercase)
N = int(input())
S = input()
Output = ''
for i in range(len(S)):
    for j in range(len(A)):
        if A[j] == S[i]:
            Output += A[(j+N) % 26]
print(Output)

Solution (Python):
def main():
    alp = ["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 = str(input())

    crypt = ""
    for c in list(s):
        crypt += alp[(alp.index(c) + n) % 26]

    print(crypt)


if __name__ == "__main__":
    main()

Solution (Python):
l=[]
for i in range(65,(65+26)):
  l.append(chr(i))
n=int(input())
s=input()
ss=""
for i in s:
  x=ord(i)-64
  y=(x+n)%26
  ss+=l[y-1]
print(ss)

Solution (Python):
alps = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

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

ans = ''

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

print(ans)

Solution (Python):
alps = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
n = int(input())
s = input()

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

Solution (Python):
alps = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
n = int(input())
s = input()

ans = ''
for i in range(len(s)):
    idx = alps.index(s[i])
    idx += n
    if 25 < idx:
        idx = idx - 26
    x = alps[idx]
    ans += x
print(ans)

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

zn = ord('Z')
ret = ''
for x in s:
  a = ord(x) + n
  if a > zn:
    a -= zn
    a += ord('A')-1
  ret += chr(a)

print(ret)

Solution (Python):


ABC_list = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

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


sList = list(s)

ans = ''

for i in range(len(sList)):
    
    ansnum = ABC_list.index(sList[i])
    
    ansnum = ansnum + n
    
    if 25 < ansnum:
        ansnum = ansnum - 26
    
    temp = ABC_list[ansnum]
    
    ans += temp

print(ans)

Solution (Python):
s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n= int(raw_input())
x = raw_input()
a = ord('A')
print ''.join([s[(ord(c) - a + n) % 26] for c in x])

Solution (Python):
n = int(raw_input())
s = raw_input()
uppercase = ['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 ch in s:
    ind = uppercase.index(ch)
    ind = (ind + n) % 26
    t += uppercase[ind]
print t

Solution (Python):
def solve(n: int, s: str) -> str:
    def inc(c: str, n: int) -> str:
        tbl = {
            0: 'A',
            1: 'B',
            2: 'C',
            3: 'D',
            4: 'E',
            5: 'F',
            6: 'G',
            7: 'H',
            8: 'I',
            9: 'J',
            10: 'K',
            11: 'L',
            12: 'M',
            13: 'N',
            14: 'O',
            15: 'P',
            16: 'Q',
            17: 'R',
            18: 'S',
            19: 'T',
            20: 'U',
            21: 'V',
            22: 'W',
            23: 'X',
            24: 'Y',
            25: 'Z',
        }
        rev_tbl = {v: k for k, v in tbl.items()}
        idx = (rev_tbl[c] + n) % len(tbl)
        return tbl[idx]

    return ''.join([inc(c, n) for c in s])


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

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

ans = ''
for i in range(len(s)):
    if ord(s[i])+n > ord('Z'):
        ans += (chr(ord(s[i])+n-26))
    else:
        ans += (chr(ord(s[i])+n))

print(ans)

Solution (Python):
n=int(input())
S=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=''
for i in range(len(S)):
  for j in range(26):
    if  S[i]==A[j]:
      alpha=j
      alpha+=n
      alpha=alpha%26
      ans=ans+A[alpha]
print(ans)

Solution (Python):
num = int(input())
str = list(input())
alp = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
out=""
for i in range(len(str)):
	for l in range(len(alp)):
		if str[i]==alp[l]:
			out+=alp[(l+num)%26]
			break
print(out)

Solution (Python):
import sys
import math
from itertools import permutations
from itertools import combinations


sys.setrecursionlimit(10**7)
N = int(input())
S = input()

l = []
for s in S:
    neww = chr(ord('A') + (( ord(s) - ord('A') + N )%26))
    l.append(neww)

print(''.join(l))

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

s = list(s)

l1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
l1 = list(l1)

l2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
l2 = list(l2)

s1 = [0]*len(s)
s2 = [0]*len(s)

for i in range(len(s)):
	s1[i] = l1.index(s[i])

for i in range(len(s)):
	s2[i] = l2[s1[i]+n] 


ans = ''
for i in range(len(s2)):
	ans = ans + s2[i]

print(ans)

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

ans = ''
for i in range(len(s)):
    if ord(s[i])+n > ord('Z'):
        ans += (chr(ord(s[i])+n - 26))
    else:
        ans += (chr(ord(s[i]) + n))

print(ans)

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

sb = ''
for char in charlist:
    charcode = ord(char)
    charcode += n
    if charcode >= 91:
        charcode -= 26
    sb += chr(charcode)
print(sb)

Solution (Python):

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

ans = []
for c in S:
    letter_offset = ord(c) - ord('A') + N 
    if letter_offset < 26:
        ans.append(chr(letter_offset + ord('A')))               
    else:
        ans.append(chr(letter_offset - 26 + ord('A')))
print("".join(ans))

Solution (Python):
ar = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
a = int(input())
br = list(input())
ans = ""
for r in br:
  b = ar.index(r) + a
  if b >= 26:
    b -= 26
  ans += ar[b]
print(ans)

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

ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ALPHABET_LEN = len(ALPHABET)
prceed_val = n % ALPHABET_LEN

def trans(s):
    pos = ALPHABET.index(s)


    newpos = pos + prceed_val


    if newpos > ALPHABET_LEN - 1:
        newpos = abs(ALPHABET_LEN - newpos)




    new_s = ALPHABET[newpos]
    return new_s

new_str= ''.join([trans(_s) for _s in s])

print(new_str)

Solution (Python):
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = list(input())
list = list(A)
result_list = []
for i in range(len(S)):
    for ie in range(len(list)):
        if S[i] == list[ie]:
             result_list.append(list[(ie + N) % 26])
print(''.join(result_list))

Solution (Python):

A = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

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

A_LIST = list(A)

result = []

for i in range(len(S)):
    for wi in range(len(A_LIST)):
        
        if S[i] == A_LIST[wi]:
            ss = (N + wi) % 26
            result.append(A_LIST[ss])

print("".join(result))

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

alphabet = ["Z", "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"]

output = []

for chara in S:
    a = alphabet.index(chara)
    b = alphabet[(a + N) % 26]
    output.append(b)

print(''.join(output))

Solution (Python):
n = int(input())
s = list(input())
string = ""
engList = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
for i in s:
    string += engList[(engList.index(i) + n) % 26]
print(string)

Solution (Python):
def main():
    N = int(input())
    S = input()
    alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    print(S.translate(str.maketrans(alp, alp[N:] + alp[:N])))
    return


main()

Solution (Python):
def main():
    N = int(input())
    S = list(input())
    ans = []
    a = ord("A")
    z = ord("Z")
    for s in S:
        if ord(s) + N <= z:
            ans.append(chr(ord(s) + N))
        else:
            ans.append(chr(ord(s) + N - z + a - 1))
    print("".join(ans))
    return


main()

Solution (Python):
N=input()
S=input()
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"]
out=[]
for i in S:
  idx=abc.index(i)
  idx=idx+int(N)%26
  if idx>25:
      idx-=26
  out.append(abc[idx])
out1=''.join(out)
print(out1)

Solution (Python):
_,l,a=int(input()),input(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
print(l.translate(str.maketrans(a,"".join(a[_:]+a[:_]))))

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

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

A = ord('A')

T = ''.join([chr(A + (ord(c) - A + N) % 26) for c in S])

print(T)

Solution (Python):
n = int(input())
s = list(input())
num_list = [ord(i)+n for i in s] 
ans_num = [(i-65)%26 + 65 for i in num_list]
ans_str = [chr(i) for i in ans_num]
ans = "".join(ans_str)
print(ans)

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

for i in S:
  n = ord(i)
  n = n + N
  if n > ord("Z"):
    n -= 26
  res += L[n - ord("A")]
  
print(res)

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

Solution (Python):

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

ans = []

for i in s:
    tmp = ((ord(i) - 65 + n) % 26) + 65
    ans.append(chr(tmp))

print(''.join(ans))

Solution (Python):
import string
N = int(input())
S = list(str(input()))
alpha = list(string.ascii_uppercase)
L = list()
for i in range(len(S)):
	L.append(alpha[(alpha.index(S[i])+N)%26])
print(''.join(L))

Solution (Python):


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

    ans = ""
    for moji in S:
        a = ord(moji) + N
        if a > ord("Z"):
            a -= ord("Z") - ord("A") + 1
        ans += chr(a)
    print(ans)

if __name__ == "__main__":
    solve()

Solution (Python):
alpha = ['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()
string = []
for i in S:
    a = alpha.index(i)
    if a+N>25:
        string.append(alpha[(a+N)%26])
    else:
        string.append(alpha[a+N])
s=''
for i in string:
    s = s+i
print(s)

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

Solution (Python):
N = int(input())
L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
S = input()
res = ""
for i in S:
  n = ord(i)
  n = n + N
  if n > ord('Z'):
    n -= 26
  res += L[n - ord('A')]
print(res)

Solution (Python):
"""

print(ord("A")) 

print(chr(65)) 

"""

n = int(input()) 
s = list(input()) 
list1 = []
for i in range(len(s)):
    number = (ord(s[i]) + n - ord("A")) %26 + ord("A")
    list1.append(chr(number))

print("".join(list1))

Solution (Python):
n = int(input())
s = list(input())
def next_chr(chara):
    if chara == "Z":
        return "A"
    else:
        return chr(ord(chara)+1)

def next_n(chara, n):
    for i in range(n):
        chara = next_chr(chara)
    return chara
for i in s:
    print(next_n(i, n), end = "")

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

list_S = list(S)

for i in range(len(list_S)):
    list_S[i] = chr( ord(list_S[i]) + N )

    if ord(list_S[i]) > ord('Z'):
        list_S[i] = chr( ord('A') + ( ord(list_S[i])- ord('Z') ) -1 )

print("".join(list_S))

Solution (Python):

N = int(input())
S = list(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", 
      "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",
      "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"]
tmp = ""
for i in range(len(S)):
    tmp += al[al.index(S[i])+N]
print(tmp)

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

ans = []

for s in S:
    if ord(s) + N > ord('Z'):
        ans.append(chr(ord(s) + N - 26))
    else:
        ans.append(chr(ord(s) + N))

print(''.join(ans))

Solution (Python):
N=input()
s=input()

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

answer=[]
for l in s:
  num=L.index(l)
  
  
  newN=L.index(l)+int(N)
  n=newN%26
  answer.extend(L[n])  
  
answer="".join(answer)
print(answer)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
S = [x - ord('A') for x in read().rstrip()]
S = [(x + N) % 26 for x in S]

answer =  ''.join(chr(x + ord('A')) for x in S)
print(answer)

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

s=[]
a="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
a+=a
for c in S:
	s+=a[a.find(c)+N]

print(*s,sep='')

Solution (Python):
import string

x = string.ascii_uppercase + string.ascii_uppercase
n = int(raw_input())
s = raw_input()
a = ord('A')
print ''.join([x[ord(c)-a+n] for c in s])

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

ab = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
d = {i:j for i,j in zip(ab,ab[n:]+ab[:n])}

print("".join([d[i] for i in s]))

Solution (Python):
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

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

ls = list(s)

for i in range(len(s)):
    idx = alpha.find(s[i])
    idx += n
    if idx >= 26:
        idx -= 26
    ls[i] = alpha[idx]


print("".join(ls))

Solution (Python):
sn = int(input())
str_ = input()

result = ''

for alphabet in str_:
  t = ord(alphabet)
  chr_int = t + sn
  if chr_int > 90:
    chr_int -= 26
  result += chr(chr_int)
print(result)

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

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

Solution (Python):
N = int(input())
str = input()
new_str = ''
 
for x in str:
  temp = ord(x)+N
  if temp>90:
    new_str += chr(temp - 26)
  else:
    new_str += chr(temp)
 
print(new_str)

Solution (Python):
n = int(input())
s = input()
alphabet = [chr(ord('A') + i) for i in range(26)]
ans = ''

for i in s:
    for j in range(26):
        if i == alphabet[j]:
            ans += alphabet[(j + n) % 26]
print(ans)

Solution (Python):
N = int(input())
S = 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']
L = [0 for i in range(len(S))]
for i in range(len(S)):
  for j in range(26):
    if S[i] == AL[j]:
      L[i] = j
for i in range(len(L)):
  L[i] = (L[i] + N) % 26
NS = ''
for i in range(len(L)):
  NS = NS[:] + AL[L[i]]
print(NS)

Solution (Python):
alp=['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 S:
    ans+=alp[(alp.index(i)+N)%26]
print(ans)

Solution (Python):
n = int(input())
inp_string = input()
result = ""
for char in inp_string:
  value = ord(char)
  value += n
  if value > 90:
    value = 64 + (value - 90)
  result += chr(value)
print(result)

Solution (Python):
N = int(input())
S = input()
A = ord('A')

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

print(ans)

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

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

a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in s:
    ans += a[(int(a.index(i)) + n)%26]
print(ans)

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

letters = [chr(ord('A') + i) for i in range(26)]

s_ = ''
for l in s:
    s_ += letters[(letters.index(l)+n)%26]


print(s_)

Solution (Python):
n = int(input())
s = input()
alp= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(s.translate(str.maketrans(alp, alp[n:] + alp[:n])))

Solution (Python):
N = int(input())
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
print("".join([a[(a.index(s)+N)%26] for s in input()]))

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

S = input()

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

for index in range(len(S)):
    temp =retsu[((alpha2num(S[index]) + N) % 26)]
    print(temp, end="")

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

st = string.ascii_uppercase

s1 = list(s)
s2 = list()
for i in range(len(s)):
    k = st.find(s1[i])
    if k>=26-n:
        k=k-26
    s2.append(st[k+n])
s2 = "".join(s2)
print(s2)

Solution (Python):
number=int(input())
day = input()

if number ==0:
  print(day)
else:
  alphabet=list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
  myIter =iter(day)
  out=list()
  for x in myIter:
    pos = alphabet.index(x)
    out.append(alphabet[pos + number])
    
  print(''.join(out))

Solution (Python):
W=["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()
T=""
for i in range(len(S)):
        k = W.index(S[i])+N
        if k>25: k=k-26
        T += W[k]
print(T)

Solution (Python):
rot = int(input())
strlist = list(input())

def shift(char, rot):
  str = ["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"]
  index = str.index(char)
  index = (index + rot) % 26
  return str[index]

ret = []
for c in strlist:
  ret.append(shift(c, rot))
 
print("".join(ret))

Solution (Python):
al = [i for i in "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"]
dic = {i:j for i,j in zip("ABCDEFGHIJKLMNOPQRSTUVWXYZ",range(26))}
n = int(input())
s = input()
ans = ""
for i in range(len(s)):
  ans += al[dic[s[i]]+n]
print(ans)

Solution (Python):
N = int(input())
S = input().strip()
after = []
for s in S:
  x = ord(s) + N
  if x > ord('Z'):
    x = x - 26
  after.append(chr(x))
print(''.join(after))

Solution (Python):
N = int(input())
S = input()
hoge=[]
Alphas='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
for a in S:
  for i, Alpha in enumerate(Alphas):
    if Alpha == a:
      hoge.append(Alphas[(i+N)%26])
      break
mojiretsu=''
for x in hoge:
    mojiretsu += x
print(mojiretsu)

Solution (Python):
alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n=int(input())
s=input()
ans=''
c=[]
for i in range(len(s)):
  c.append(alphabet[(n+alphabet.index(s[i]))%26])
print(''.join(c))

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

for i in range(0, len(S_list)):
    M = ord(S_list[i]) + N
    if M > 90:
        M -= 26
    S_list[i] = chr(M)

print(''.join(S_list))

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

a = [chr(i) for i in range(65, 65+26)]
b = [chr(i) for i in range(65+N, 65+26)]
for i in range(N):
    b.append(a[i])

a_dict = {}
for i in range(len(a)) :
    a_dict[a[i]] = b[i]
for i in range(len(S)) :
    S[i] = a_dict[S[i]]

print(''.join(S))

Solution (Python):
n = int(input())
s = list(input())
al = [chr(ord('A') + i) for i in range(26)]
dic = {chr(ord('A') + i):i for i in range(26)}
al = al[n:] + al[:n]
ans = [al[dic[i]] for i in s]
print(''.join(ans))

Solution (Python):
N = int(input())
S = list(input())
arufa = ['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)):
    for j in range(26):
        if arufa[j] == S[i] :
            p = (j + N) % 26
            ans.append(arufa[p])
print("".join(ans))

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

for i in range(0,len(S_list)):
    M = ord(S_list[i])+N
    if M > 90:
        M -= 26
    S_list[i] = chr(M)

print("".join(S_list))

Solution (Python):
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines



























def main():
	n=int(input())
	s=input().rstrip().decode('utf-8')
	
	al="ABCDEFGHIJKLMNOPQRSTUVWXYZ"*3
	ans=""
	
	for i in s:
		ans+=al[al.index(i)+n]
		
		
	print(ans)
	
	
	
	







if __name__ == "__main__":
		main()

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


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

    for s in S:
        a = ord(s) + N
        if a > ord('Z'):
            a = ord('A') + a - ord('Z') - 1
        print(chr(a), end="")



if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
s = list(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']
d_al = {'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}

al = al[n:] + al[:n]
ans = [al[d_al[i]] for i in s]
print(''.join(ans))

Solution (Python):
n=int(input())
s=input()
l=len(s)
u=[]
for i in range(l):
  u.append(s[i])
alp=[]
d="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for j in range(26):
  alp.append(d[j])
for k in range(l):
  for h in range(26):
    if u[k]==alp[h]:
      u[k]=alp[(h+n)%26]
      break

for b in range(l):
  print(u[b], end="")

Solution (Python):
Al = [i for i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']
Num = [j for j in range(26)]
A = {key: value for key, value in zip(Al, Num)}
B = {key: value for key, value in zip(Num, Al)}
N = int(input())
S = [A[p] + N if A[p] + N < 26 else A[p] + N - 26 for p in input()]
ans = ''.join([B[q] for q in S])
print(ans)

Solution (Python):
alp_list = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S_list = list(input())
Slen = len(S_list)
S_return_list = []
for i in range(0,Slen):
  S_return_list.append(alp_list[(alp_list.index(S_list[i])+N)%26])
S_return="".join(S_return_list)
print('{}'.format(S_return))

Solution (Python):
N = int(input())
S = list(input())
res =[]
for s in S:
    if(ord(s) + N > 90):
        res.append(chr((ord(s)+N-26)))
    else:
        res.append(chr((ord(s)+N)))
print("".join(res))

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

Solution (Python):
t="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
n=int(input())
print("".join([t[t.index(i)+n]for i in input()]))

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

alphabet = [chr(i) for i in range(65, 65+26)]*2
l = []
for i in range(len(s)):
    k = alphabet.index(s[i])
    l.append(k)
    
ans = []
for j in range(len(l)):
    ans.append(alphabet[l[j]+n])
    
for a in range(len(ans)):
    print(ans[a], end='')

Solution (Python):
n = int(input())
s = input()
ns = []
for i, ch in enumerate(s):
    index = ord(ch)
    index += n
    if(index>90):
        index -= 26
    ns.append(chr(index))
print("".join(ns))

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

result = ""
for i in s :
    result += chr(((ord(i) + n - 65) % 26) +65)

print(result)

Solution (Python):
az = [chr(i) for i in range(65, 65+26)]
n  = int(input())

result = []
for l in list(input()):
  c = n + az.index(l)
  if c > 25:
    c = c - 25 - 1
  result.append(az[c])

print(''.join(result))

Solution (Python):
n = int(input())
str = input()
ans = ""
for l in str:
  if ord(l) + n > 90:
    ans += chr((ord(l)+n)%90 + 64)
  else:
    ans += chr(ord(l)+n)
print(ans)

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

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

Solution (Python):
n = int(input())
s = ""
for m in input():
    if ord(m)+n > 90:
        s += chr(ord(m)+n-26)
    else:
        s += chr(ord(m)+n)
print(s)

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

Solution (Python):
n = int(input())
s = input()
ns = ""
for c in s:
  asc = ord(c)+n 
  if asc > 90:
    asc -= 26
  ns += chr(asc)
print(ns)

Solution (Python):
alphabet = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

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

for char in S:
    n = alphabet.index(char)
    n_2 = n + N
    n_3 = n_2 % 26
    print(alphabet[n_3], end="")

print()

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

Solution (Python):
N = int(input())
S = input()
chars = list(S)
ans = map(lambda x: chr((ord(x) - 65 + N) % 26 + 65), chars)
print(''.join(list(ans)))

Solution (Python):




def I(): return int(input())


def IsIl(): return list(map(lambda x: int(x), input().split()))


def InIl(n): return [input() for i in range(n)]


def IsIt(): return map(lambda x: int(x), input().split())


def InIl(n): return map(input() for i in range(n))


def SsSl(): return list(map(lambda x: x, input()))




def SSd():
    from collections import defaultdict
    A = input() 
    dd=defaultdict(int)
    for a in A:
        dd[a]+=1
    return dd







def alpha2num(c):
    return ord(c) - ord('A') + 1

def num2alpha(num):
    return chr(num + ord("A") - 1)

n = I()
s = input()

ans = ''
for item in s:
    num = alpha2num(item) + n
    if num > 26:
        num -= 26
    ans += num2alpha(num)

print(ans)

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

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

Alphabet = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

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

print(''.join(S))

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

print(ans)

Solution (Python):
n=int(input())
s=input()
l=list(s)
newcome=[]
alp=[chr(ord('A') + i) for i in range(26)]
for i in l:
  a=alp.index(i)
  if (a+n)<26:
    t=alp[a+n]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))

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

ret = []
for c in s:
    new = ord(c) + n
    if not ord('A') <= new <= ord('Z'):
        new -= 26
    ret.append(chr(new))

print(''.join(ret))

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

alp = [chr(i) for i in range(ord('A'), ord('Z')+1)]
alp_num = 0

def moji(c):
    m = ''
    for num,alphabet in enumerate(alp):
        if c == alphabet:
            m = alp[(num+N)%26]
    return m
S2 = '' 
s = ''   
for i in S:
    s = moji(i) 
    S2 = S2 + s

print(S2)

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

for i in range(len(s)):
    
    ans += alpha[alpha.find(s[i]) + n]

print(ans)

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

ret = ""
for s in list(S):
    a = ord(s)
    max_z_a = a - 26 if a + N > 90 else a
    ret += chr(max_z_a + N)
print(ret)

Solution (Python):
abc_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())
abc_input = input()
abc_each = list(abc_input) 


ans_abc = []
for abc in abc_each :
    for i,j in enumerate(abc_list) :
        if abc == j :
            num = (i+n) % 26
            ans_abc.append(abc_list[num])
            

answer = ''

for x in ans_abc:
    answer += x

print(answer)

Solution (Python):
k=int(input())
def rof(n):
  return (n-65+k)%26+65
s=list(map(rof,input().encode('ascii')))
for num in s:
  print(chr(num),end='')

Solution (Python):
n = int(input())
s = list(input())
m = len(s)
for i in range(m):
    if ord(s[i])+n > 90:
        s[i] = chr(ord(s[i])+n-26)
    else:
        s[i] = chr(ord(s[i])+n)
for i in s:
    print(i,end="")

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

ans = ''
for char in s:
    code = ord(char) - 65
    code = (code+n) % 26
    code = code + 65
    ans += chr(code)

print(ans)

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

ans=''
for s in S:
  if ord(s)+n>90:
    ans+=chr(ord('A')+n-(90-ord(s))-1)
  else:
    ans+=chr(ord(s)+n)
print(ans)

Solution (Python):
n=int(input())
s=input()
v=["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)):
    for j in range(len(v)):
        if s[i]==v[j]:
            ans.append(v[(j+n)%26])

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

Solution (Python):
n=int(input())
s=list(input())
for i in range(len(s)):
    num = ord(s[i])+n
    if(num>90):
        s[i] = chr(num%90 + 64)
    else:
        s[i] = chr(num)
print(''.join(s))

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

for i in range(n):
    p = ord(s[i])
    p += k
    if p > 90:
        p -= 26
    s[i] = chr(p)
print(''.join(s))

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

dictionary = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

result = ""
for s in S:
	next_index = dictionary.find(s) + N
	if next_index > len(dictionary) - 1:
		next_index = next_index - len(dictionary)
	result += dictionary[next_index]

print(result)

Solution (Python):
N=int(input())
S=input()
t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"*2
ans=""
for i in S:
  ans+=t[t.index(i)+N]
print(ans)

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

Solution (Python):



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

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

lis1 = list(map(lambda x: alpha2num(x), A))
lis2 = list(map(lambda x: (x + N) % 26, lis1))
lis3 = list(map(lambda x: x + 26 if x == 0 else x, lis2))
lis4 = list(map(lambda x: num2alpha(x), lis3))

print(''.join(lis4))

Solution (Python):
N = int(input())
S = input()
Answer_list = []
for i in list(S):
    num = ord(i)+N
    if num >= 65 and num <= 90:
        Answer_list.append(chr(num))
    elif num > 90:
        Answer_list.append(chr(num - 26))
print(''.join(Answer_list))

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

m = ""
for i in range(ord('A'), ord('Z') + 1):
    m += chr(i)
S2 = []
for c in S:
    i = ord(c) - 65
    S2.append(m[(i + N) % len(m)])
print(''.join(S2))

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

ans = ""
for s in S:
    ans += al[(al.index(s) + N) % 26]
print(ans)