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()

x_lst = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

ans = []

for s in S:
    for i, x in enumerate(x_lst):
        if x == s:
            ans.append(x_lst[(i+N)%26])
print(''.join(ans))

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

a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

def find_alp(c, n):
    index = a.find(c)
    if index + n > 25:
        return a[index + n - 26]
    else:
        return a[index + n]

for j, c in enumerate(s):
    s[j] = find_alp(c, n)

print("".join(s))

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

alpha = [chr(i) for i in range(65, 65+26)]

for i in range(len(S)):
    index = alpha.index(S[i]) + N
    if index > 25:
        index -= 26
    S[i] = alpha[index]

print("".join(S))

Solution (Python):

N = int(input())
S =list(input())
ans = []
for i in S:
    tmp = ord(i)
    tmp += N
    if tmp > 90:
        tmp -= 26
    ans.append(chr(tmp))
print("".join(ans))

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

S_num = []
S_ans = []

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

for i in range(len(S)):
    tmp = alpha2num(S[i]) + N
    if int(tmp) >= 27:
        tmp = int(tmp) - 26
    
    S_num.append(tmp)

for t in range(len(S)):
    S_ans.append(num2alpha(S_num[t]))

print("".join(S_ans))

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

alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

list_S = list(S)
for i in range(len(list_S)):
    alpha_before = alphabet.index(list_S[i])
    alpha_after = (alpha_before + N) % 26
    list_S[i] = alphabet[alpha_after]

print(''.join(list_S))

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

for a in s:
    i = ord(a) + n
    i = i * (i <= 90) or i - 26
    print(chr(i), end='')
print()

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

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


num2alpha = lambda c: chr(c+64)

num2alpha(3) 

ans = []

for i in range(len(s)):
    
    if (alpha2num(s[i])+n) % 26 == 0:
        ans.append(num2alpha(26))
        continue
    ans.append(num2alpha((alpha2num(s[i])+n)%26))
    
print(*ans,sep='')

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 = list(input())
alp = [chr(i) for i in range(65, 65+26)] * 2

for i in range(len(s)):
    s[i] = alp[alp.index(s[i]) + n]
print(*s,sep="")

Solution (Python):
N = int(input())
S = [i for i in input()]
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']
ans=''
for c in S:
    cnt = alpha.index(c)+N
    if cnt > 25:
        cnt=cnt-26
    c = alpha[cnt]
    ans+=c
print(ans)

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

for i in range(len(S)):
  

  ord_ch = ord(S[i])
  ord_ch += N
  if ord_ch > ord('Z'):
    ord_ch -= 26
  S[i] = chr(ord_ch) 
print(*S, sep='')

Solution (Python):


''' 
------------------------
author : iiou16
------------------------
'''

import string

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

    alf = string.ascii_uppercase

    out = ""
    for s in S:
        ind = alf.find(s)
        out += alf[(ind + N) % len(alf)]
    
    print(out)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
s = list(input())
 
str = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
alist = list(str)

m=0
ans = ""
for i in s:
  ans += alist[alist.index(i) + n]
print(ans)

Solution (Python):
N=int(input()) 
S = input()
num2alpha = lambda c: chr(c+64)
alpha2num = lambda c: ord(c) - ord('A') + 1

def rot(n):
  if n>26:
    return n-26
  else:
    return n

ans =''
for i in S:
  ans  = ans+num2alpha(rot(alpha2num(i)+N))
  

print(ans)

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

def rot(c, n):
	new_c_ord = ord(c) + n
	if new_c_ord >= 91:
		new_c_ord -= 26
	return chr(new_c_ord)

res = ''.join([rot(c, n) for c in list(s)])

print(res)

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

alphabets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

result = ''
for w in S:
    index = alphabets.index(w)
    index = (index + N) % 26
    result += alphabets[index]
print(result)

Solution (Python):

N = int(input())

encryptionStr = input()

excludeStr = ""

result = ""

SHIFT_COUNT = N

for c in encryptionStr :

    if excludeStr.find(c) != -1 :
        result = result + c
        continue


    if ord('a') <= ord(c) <= ord('z') :
        result = result + chr(abs(((ord(c) + SHIFT_COUNT - ord('a')) % 26)) + ord('a'))
    else :
        result = result + chr(abs(((ord(c) + SHIFT_COUNT - ord('A')) % 26)) + ord('A'))

print (result)

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


a = 65
z = 90

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

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

Solution (Python):
n = int(input())
s = input()
abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = [None]*(len(s))

for i in range(len(s)):
    ans[i] = abc[abc.index(s[i])+n-26]

print(''.join(ans))

Solution (Python):
N = int(input())
S = input()
n = len(S)
ans = ''
for i in range(n):
    a = (ord(S[i])-65+N)%26
    a += 65
    b = chr(a)
    ans += b
print(ans)

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

ans = ""
for s in S:
    ans += chr((ord(s) + N - 65)%26 + 65)
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"]
ans=""
for i in range(len(s)):
    x=alphabet.index(s[i])
    ans+=alphabet[(x+n)%26]
print(ans)

Solution (Python):
num = int(input())
words = input()

after_words = []
for w in words:
    tmp_w = ord(w)
    tmp_w += num
    if tmp_w > 90:
        tmp_w -= 26
    after_words.append(chr(tmp_w))

print("".join(after_words))

Solution (Python):
from collections import defaultdict
def main():
    ls = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    dic_str = defaultdict(int)
    dic_num = defaultdict(str)
    for i,st in enumerate(ls):
        dic_str[i] = st
        dic_num[st] = i
    n = int(input())
    s = input()
    ans = ""
    for i in s:
        num = dic_num[i]
        if num+n>25:
            num -= 26
        ans = ans + str(dic_str[int(num)+n])
    print(ans)

if __name__=='__main__':
    main()

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

Solution (Python):
n = int(input())
s = 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)):
     for l in range(len(L)):
         if s[i]==L[l]:
             ans += L[((l+n)%len(L))]
print(ans)

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

print(ans)

Solution (Python):
if __name__ == "__main__":
    n = int(input())
    s = input()

    alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

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

    print(ans)

Solution (Python):

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

result = []

for char in s:
    
    i = ord(char)
    i += n
    if i > 90:
        i -= 26
    afterchar = chr(i)
    result.append(afterchar)

print("".join(result))

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

Solution (Python):

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

s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
s = s[N:] + s[:N]
print(S.translate(str.maketrans("ABCDEFGHIJKLMNOPQRSTUVWXYZ", s)))

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

rot = ""
for s in S:
    if ord(s) + N >= 91:
        rot += chr(ord(s)+N-26)
    else:
        rot += chr(ord(s)+N)
print(rot)

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

print(k)

Solution (Python):


def main():
    N = int(input())
    S = input()
    new_S = ''
    for i in range(len(S)):
        new_S += judgeChangeChara(S[i],N)
    print(new_S)
    

def judgeChangeChara(chr,N):
    alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    index = alphabet.find(chr)
    if index+N > 25:
        return alphabet[(index+N) - 26]
    else:
        return alphabet[index + N]


if __name__ == "__main__":
    main()

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

alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""

for i in range(len(S)):
    for j in range(26):
        if S[i] == alphabets[j]:
            if j + N < 26:
                ans += alphabets[j + N]
            else:
                ans += alphabets[j + N - 26]
            break
print(ans)

Solution (Python):
n = int(input())
moji = 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","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"]
new_moji = []
for i in range(len(moji)):
    new_moji.append(alphabet[alphabet.index(moji[i]) + n])
print("".join(new_moji))

Solution (Python):

SHIFT_COUNT = int(input())

encryptionStr = input()

excludeStr = "{}_"

result = ""

for c in encryptionStr :
    
    if excludeStr.find(c) != -1 :
        result = result + c
        continue

    
    if ord('a') <= ord(c) <= ord('z') :
        result = result + chr(abs(((ord(c) + SHIFT_COUNT - ord('a')) % 26)) + ord('a'))
    else :
        result = result + chr(abs(((ord(c) + SHIFT_COUNT - ord('A')) % 26)) + ord('A'))

print (result)

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

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

enc = ""

for char in list(s):
    num = ord(char) - 65
    num = (num + n) % 26
    enc += chr(num + 65)

print(enc)

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

ans = ""
for str in S:
   tmp = ord(str) + N 
   if tmp >= 91: tmp -= 26
   ans += chr(tmp)

print(ans)

Solution (Python):


import sys
def input():
    return sys.stdin.readline().rstrip()

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

    d=ord('Z')-ord('A') + 1

    for c in S:
        o = (ord(c)-ord('A')+N)%d + ord('A') 
        print(chr(o), end="")



if __name__ == '__main__':
    main()

Solution (Python):
alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
N = int(input())
S = input()
result=[]
for i in list(S):
    result.append(alphabet[alphabet.index(i)+N])
mojiretsu = ''.join(result)
print(mojiretsu)

Solution (Python):
n = int(input())
s = list(input())
x = len(s)
ans = []
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"]
for i in range(x):
  ans.append(abc[(abc.index(s[i])+n) % 26])
print("".join(ans))

Solution (Python):
N = int(input())
S = input()
ans = ""
for s in S:
  if ord(s) + N <= ord("Z"):
    ans += chr(ord(s) + N)
  else:
    ans += chr(ord(s) + N - 26)
print(ans)

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




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

Solution (Python):
n = int(input())
s = list(input())
character = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(s)):
  for j in range(len(character)):
    if s[i]==character[j]:
      num = (j+n)%len(character)
      s[i] = character[num]
      break
print("".join(s))

Solution (Python):


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

ans = [None] * len(S)


for i, s in enumerate(S):
    n = ord(s)
    ans[i] = chr(n + N) if n+N <= 90 else chr(64 + (n+N-90))

print("".join(ans))

Solution (Python):

MOD = 10 ** 9 + 7

import math



def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def main():

    n= int(input())
    s= list(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"]

    b=[]
    for i in range(len(s)):
        temp=a.index(s[i])
        temp+=n
        if temp>=26:
            temp-=26
        s[i]=a[temp]


    c="".join(s)
    print(c)


if __name__ == "__main__":
    main()

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

Solution (Python):
n = int(input())
ls = list(map(str,input()))
book =["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 a in ls:
    ans.append(book[(book.index(a)+n)%26])
print("".join(ans))

Solution (Python):
import heapq as h
import math
import numpy as np
import copy
import itertools

 

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']
def change(a,n):
    ix = alphabet.index(a)
    ix += n
    return alphabet[ix%26]
new = ''
for tmp in s:
    new += change(tmp,n)
print(new)

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

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

alphabet = {"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":26}

abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

ans = ""
for char in S:
    num = alphabet[char]
    ans = ans + abc[(num+N)%26-1]

print ans

Solution (Python):
n = int(input())
s = input()
l = []
m = 0

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

Solution (Python):

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()




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

print(''.join(S))

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

ans=""
for x in S:
    idx=str.index(x)
    idx+=N
    idx%=26
    ans+=str[idx]
print ans

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

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

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

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

ans = []
base = ord("A")
for c in S:
    ans.append(chr(((ord(c) + N - base) % 26)+base))

print("".join(ans))

Solution (Python):

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

alpha_list = [chr(i) for i in range(65, 65+26)]
ans = ""
for s in S:
    ans += alpha_list[(alpha_list.index(s) + N) % 26]
print(ans)

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

for i in s:
    num = ord(i) + n
    while num > 90:
        num -= 26
    ans += chr(num)
print(ans)

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

text = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
res = ''

for i in s:
    j = text.index(i)
    k = (j + n) % 26
    res += text[k]

print(res)

Solution (Python):
N = int(input())
S = list(input())
ans_S = []

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']

for i in range(len(S)):
  if l.index(S[i]) + N <= 25:
    ans_S.append(l[l.index(S[i]) + N])
  else:
    ans_S.append(l[l.index(S[i]) + N - 26])
    
print(str(''.join(ans_S)))

Solution (Python):
n = int(input())
S = list(input())
temp=['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] = temp[((temp.index(S[i]))+n)%26]
print(*S,sep='')

Solution (Python):

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

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"]

new_s = []
for i in range(len(s)):
    i_num = alphabet.index(s[i])
    if i_num + 1 + n <= 26:
        new_num = i_num + n
    else:
        new_num = n + i_num  - 26
    new_s.append(alphabet[new_num])

print("".join(new_s))

Solution (Python):
alpha = [i for i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']
n = int(input())
s = input()

l = []
for i in s:
    idx = (alpha.index(i) + n)%26
    l.append(alpha[idx])

print(''.join(l))

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


def main():
    sc = Scan()
    n = sc.intarr()[0]
    s = sc.strarr()[0]

    new_str = ''
    for i in s:
        i = ord(i)
        i = i + n
        if i > 90:
            i -= 26
        i = chr(i)
        new_str += i

    print(new_str)


class Scan():

    def intarr(self):
        line = input()
        array = line.split(' ')
        num_array = [int(n) for n in array]
        return num_array

    def intarr_ver(self, n):
        return [int(input()) for _ in range(n)]

    def strarr(self):
        line = input()
        array = line.split(' ')
        array[-1] = array[-1].strip('\n')
        return array


main()

Solution (Python):
n = int(input())
s = input()
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
t = []
for c in s:
    k = (a.index(c) + n) % 26
    t.append(a[k])

print(''.join(t))

Solution (Python):


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

convert_list = {}
for i in range(26):
    charactor = (i + N) % 26
    convert_list[chr(i+65)] = chr(charactor+65)

new_S = ''
for i in range(len(S)):
    new_S += convert_list[S[i]]

print(new_S)

Solution (Python):
N = int(input())
S = input()
L = len(S)
T = ''
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

for i in range(L):
  for j in range(26):
    if S[i] == alpha[j]:
      T = T + alpha[j + N]
      break

print(T)

Solution (Python):
import collections
import itertools as it
import math
import numpy as np









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



for s in S:
    
    print(chr(((ord(s) + N) - 65) % 26 + 65), end="")

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

Solution (Python):
N = int(input())
S = list(input())
for c in S:
    print(chr((ord(c) - ord('A') + N) % 26 + ord('A')), end='')

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

ans = ""

for i in range(len(s)):
  ans += chr(65 + (ord(s[i]) - 65 + n) % 26)

print(ans)

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


def index(s, N):
    ABC = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 
    s_ind = ABC.find(s)
    an_ind = (s_ind + N) % 26
    return(ABC[an_ind])

rotn = ''
for s in S:
    rotn += index(s, N)
print(rotn)

Solution (Python):
N = int(input())
S = input()
S = [i for i in S]
list1 = ['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']


newlist = []
for i in range(len(S)):
    ind1 = list1.index(S[i])
    newlist.append(list1[ind1+N])

ans = ''.join(newlist)
print(ans)

Solution (Python):
alpha=lambda x:chr(x+64)
num=lambda x:ord(x)-ord("A")+1

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

for i in range(len(s)):
    now=num(s[i])
    num_now=(now+n)%26
    if num_now==0:
        num_now=26
    ans+=alpha(num_now)
print(ans)

Solution (Python):
import string

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

S =[]
al = []
new = []

for l in s:
    S.append(l)

for x in string.ascii_uppercase:
    al.append(x)

for i in range(len(s)):
    ind = al.index(S[i])
    new_ind = (ind + n) % 26
    new_s = al[new_ind]
    new.append(new_s)

ans = ''.join(new)
print(ans)

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

alp='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
num=[i for i in range(26)]

def f(s, n, alp, add):
  out=[0 for i in range(n)]
  for i in range(n):
    for j in range(26):
      if s[i]==alp[j]:
        out[i]=j
        
  out2=[out[i]+add for i in range(n)]
  out3=[out2[i]%26 for i in range(n)]
  out4=[alp[out3[i]] for i in range(n)]
  return out4

ans=f(S, length, alp, N)

print("".join(ans))

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

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

Solution (Python):
n = int(input())
s = input()
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
b = ""
for i in s:
    j = (alpha.index(i) + n) % 26
    b += alpha[j]
print(b)

Solution (Python):
n = int(input())
s = input()
ans = ''
c = ['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)):
    char = s[i]
    idx = c.index(char)
    new_idx = (idx + n) % 26
    ans += c[new_idx]
print(ans)

Solution (Python):
n=int(input())
t=input()
s=""
for i in range(0,len(t)):
    if(ord(t[i])+n<=90):
        s=s+chr(ord(t[i])+n)
    else:
        d=(ord(t[i])+n)%91+65
        s=s+chr(d)
print(s)

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

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

alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in range(len(S)):
    ind = alph.index(S[i]) + N
    if ind >= len(alph):
        ans += alph[ind-len(alph)]
    else:
        ans += alph[ind]
print(ans)

Solution (Python):
N = int(input())
S = list(input())
az = [chr(ord('A') + i) for i in range(26)]
ans = []
for x in S:
    i = (az.index(x) + N) % len(az)
    ans.append(az[i])
print(''.join(ans))

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

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

result = ""

for s in S:
    c = ord(s)
    k = c + N
    if 65 <= k <= 90:
        result += chr(k)
    else:
        result += chr(k - 26)

print(result)

Solution (Python):
def main():
    N = int(input())
    S = input()
    s = []

    for x in S:
        if (ord(x) + N) > 90:
            s.append(chr(ord(x) + N - 26))
        else:
            s.append(chr(ord(x) + N))

    print(*s, sep='')


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
s = input()
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"*2
answer = ""
for i in range(len(s)):
    index = alphabet.index(s[i])
    index += n
    answer += alphabet[index]
print(answer)

Solution (Python):
n = int(input())
s = list(input())
answer = []

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"]

for let in s:
    originalIndex = alpha.index(let)
    if originalIndex+n > len(alpha) - 1:
        answer.append(alpha[originalIndex+n-len(alpha)])
    else:
        answer.append(alpha[originalIndex+n])

print("".join(answer))

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

ABC=[chr(i) for i in range(65, 65+26)]+[chr(i) for i in range(65, 65+26)]
M=N%26

for s in S:
  print(ABC[ABC.index(s)+M], end="")

Solution (Python):

from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]


    n = II()
    s = input()
    a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    b = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
    ans = ""
    for i in range(len(s)):
        ans = ans + (b[a.find(s[i]) + n])
    print(ans)





if __name__ == '__main__':
    main()

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

Solution (Python):
n = int(input())
s = input()
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
num = 26-n
for w in s:
    print(a[a.find(w)-num], sep='', end='')

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

print(OUT)

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

def decode(string):
    res = []
    for s in string:
        res.append(chr((ord(s) - ord('A') + n) % 26 + ord('A')))
    return ''.join(res)

print(decode(s))

Solution (Python):
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
d = {'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}
n = int(input())
s = input()

for i in range(len(s)):
  print(a[d[s[i]] + n], end='')

Solution (Python):
def main():
    alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    n = int(input())
    s_list = list(input())

    s_list_n = [0] * len(s_list)
    ans_list = [0] * len(s_list)
    for i, s in enumerate(s_list):
        temp = (alphabet.find(s) + n) % len(alphabet)
        ans_list[i] = alphabet[temp]

    ans = ''.join(ans_list)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
S = input()
a = []
for i in S:
    b = ord(i)+N
    if b > 90:
        b = b-26
    a.append(chr(b))

print(''.join(a))

Solution (Python):
from string import ascii_uppercase as alpha
n=int(input())
s=list(input())
z=''
alphab=(alpha*2)[n:26+n]
for i in s:
    z+=alphab[alpha.index(i)]
print(z)

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

S_ = []
for i in range(len(S)):
    new = ord(S[i]) + N
    if ord("A") <= new <= ord("Z"):
        pass
    else:
        new = new - ord("Z") + ord("A") - 1
    S_.append(chr(new))
for s in S_:
    print(s, end="")
print()

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

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
bfs = list(input())
s = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
afs = []
for i in bfs:
    a = s.index(i)
    afs.append(s[a+n])
ans = "".join(afs)
print(ans)

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

Solution (Python):



A='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N=int(input())
S=str(input())
res=''
for i in range(len(S)):
  aN=A.index(S[i])+N
  if aN>25:
    aN-=26
  res+=A[aN]

print(res)

Solution (Python):
N = int(input())
S = list(input())
l =[""]*len(S)
for i in range(len(S)):

  l[i]=chr((ord(S[i])-ord('A')+N)%26+ord('A'))
print("".join(l))

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

a = ''

for i in range(len(S)):
  s = ''
  if ord(S[i]) + N <= 90:
    s = chr(ord(S[i]) + N)
  else:
    s = chr(ord(S[i]) + N - 26)
  a = a + s
  
print(a)

Solution (Python):



def solve(*args: str) -> str:
    n = int(args[0])
    S = args[1]

    A = ord('A')
    AtoZ = ord('Z')-A+1

    ret = ''
    for c in S:
        ret += chr(((ord(c)-A+n) % AtoZ)+A)
    return ret


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

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

for c in S:
    print(alpha[(alpha.index(c) + N) % 26], end="")

print()

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

def main():
    n = int(input())
    s = list(input().rstrip())

    ans = ""

    for x in s:
        i = ord(x) + n
        if i > 90:
            i = i - 26

        ans += chr(i)

    print(ans)



if __name__ == '__main__':
    main()

Solution (Python):

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

ans = ''

for char in S.lower():
    num = ord(char)
    num -= 97
    num = (num + N) % 26
    num += 97
    ans += chr(num)

print(ans.upper())

Solution (Python):

num = int(input())
target = input()

def next_char(c, n):
    tmp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    new = tmp.find(c) + n
    if new >= 26:
        new -= 26
    return tmp[new]

out = ""
for i in range(len(target)):
    new_char = next_char(target[i], num)
    out = out + new_char

print(out)

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"]
dic = {}
for i in range(len(alp)):
    dic[alp[i]]=i

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

s = ""

for i in range(len(S)):
    num = (int(dic[S[i]])+N)%26
    s+=alp[num]
    
print(s)

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

al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for i in range(len(S)):
    for j in range(26):
        if S[i] == al[j]:
            if j + N < 25:
                S[i] = al[j+N]
            else:
                S[i] = al[j+N-26]
            break

mojiretsu = ','.join(S)
print(str(mojiretsu).replace(',', ''))

Solution (Python):
N = int(input())
S = input()
A = []
for i in range(len(S)):
    A.append(chr(65 + ((ord(S[i]) - 65 + N) % 26)))

print("".join(A))

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

Solution (Python):
n = int(input())
s = input()
for i in range(len(s)):
    asc = ord(s[i])
    if asc <= 90 - n:
        asc += n
        s = s[:i] + chr(asc) + s[i+1:]
    else:
        asc = 65 + (asc + n - 90) - 1    
        s = s[:i] + chr(asc) + s[i+1:]
print(s)

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

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

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

N = int(readline())
S = [int(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)