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 = list(input())


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)

result = caesar(s, n)
print(result)

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

ans = ''
for s in S:
    c = ord(s)+N
    if c > ord('Z'):
        c = ord('A')+c-ord('Z')-1
    ans += chr(c)

print(ans)

Solution (Python):
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def main():
  n = ni()
  s = ns()
  ans = ""
  for ss in s:
    x = ord(ss) + n
    if x > 90:
      x -= 26
    ans += chr(x)
  print(ans)

if __name__ == '__main__':
  main()

Solution (Python):
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"] * 2

n = int(input())
string = input()

output = ''
for s in string:
    for i in range(26):
        if alphabet[i] == s:
            output += alphabet[i + n]

print(output)

Solution (Python):
import string
letters=string.ascii_letters.upper()
n=int(input())
s=input()
ans=''
for c in s:
    ans+=letters[letters.find(c)+n]
print(ans)

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

Solution (Python):
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
d1 = {}
d2 = {}
for i in range(26):
    d1[i] = alp[i]
    d2[alp[i]] = i
N = int(input())
S = input()
ans = []
for i in range(len(S)):
    s = S[i]
    n = d2[s]
    n += N
    n %= 26
    ans.append(d1[n])
print(''.join(ans))

Solution (Python):
N = int(input())
S = input()
for s in S:
    ascii = ord(s) + N
    if ascii >= 91:
        ascii -= 26
    print(chr(ascii), end='')

Solution (Python):
import numpy as np
import collections
import sys
base = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = input()
ret = ''
for c in S:
    K = base.find(c)
    ret += base[K+N]
print(ret)

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

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)

print(caesar(s,26-n))

Solution (Python):
N = int(input())
S = input()
X = ["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"]
res = ""
for s in S:
    moto_index = X.index(s)
    index = moto_index+N
    if(index >= 26):
        index -= 26
    res += X[index]
print(res)

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

chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
chars = chars + chars + chars

out = ""
for c in s:
    i = chars.index(c)
    outc = chars[i+n]
    out += outc
print(out)

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

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

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

Solution (Python):
Al = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
S = input()
ans = ""
for c in S:
    ans += Al[Al.index(c)+n]
print(ans)

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

ordA = ord('A')

ans = ''
for S in Ss:
    i = ord(S) - ordA
    i = (i+N) % 26
    ans += chr(ordA + i)

print(ans)

Solution (Python):
N=int(input())
S=input()
def f(c):
    return chr(ord(c)+N) if ord(c)+N<=ord('Z') else chr(ord(c)-26+N)
print(*[f(c) for c in S],sep='')

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

ans = ''
for ch in S:
    ans += chr(ord('A') + ((ord(ch) - ord('A') + N) % 26))
print(ans)

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

alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
alpha2=alpha*2
ans=""
for ss in s:
    ans+=alpha2[alpha.index(ss)+n] 
print(ans)

Solution (Python):
import string
N = int(input())
S = input()
abcn = string.ascii_uppercase[N:] + string.ascii_uppercase[:N]
o_n = {o: n for o, n in zip(string.ascii_uppercase, abcn)}
print(''.join([o_n[s] for s in S]))

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

from string import  ascii_uppercase

X = ascii_uppercase + ascii_uppercase

pos = {}

for i, s in enumerate(ascii_uppercase):
    pos[s] = i

ans = ""

for s in S:
    p = pos[s] + N
    ans += X[p]
print(ans)

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

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

alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""

for a in s:
  idx = (alp.find(a)+n) % len(alp)
  ans += alp[idx]

print(ans)

Solution (Python):
n = int(input()) % 26
s = input().strip()
ans = []
for c in s:
    tmp = chr(ord('A') + ((ord(c) - ord('A') + n) % 26))
    ans.append(tmp)
print(''.join(ans))

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

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

Solution (Python):
n=int(input())
s=input()
a=[]
for x in s:
    b=ord(x)+n
    if b>90:
        b-=26
    a.append(chr(b))
print("".join(a))

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

Solution (Python):

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

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

ans = ['A']*len(S)
for i in range(len(S)):
    tmp = alpha2num(S[i])
    tmp += N
    tmp %= 26
    c = num2alpha(tmp)
    ans[i] = c

print(''.join(ans))

Solution (Python):
n = int(input())
hirabun = input()
A = list(range(65,91))


def enc(m):
    hira   = list(m.encode("ascii"))
    ango   = hira.copy()
    for i, code in enumerate(hira):
        if 65 <= code <= 91:
            ango[i] = A[ (A.index(code) + n) % 26]
    c = bytes(ango).decode("ascii") 
    return c

angobun = enc(hirabun)
print(angobun)

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

for x in input():
    print(s[(s.index(x) + n) % 26], end = '')

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

result = ''
l = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
n = len(l)

for s in S:
  result += l[(l.index(s) + N)%n]

print(result)

Solution (Python):
s='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n=int(input())
st=input()
an=''
for i in st:
  an+=s[(s.index(i)+n)%26]
print(an)

Solution (Python):




def main():
  s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  n = int(input())
  v = input().strip()
  r = ''.join(s[(s.index(x) + n) % 26] for x in v)

  print(r)


if __name__ == '__main__':
  main()

Solution (Python):
n = int(input())
s = input()
newS = []
for i in s:
    new = chr(ord(i) + n)
    if new > "Z":
        new = chr(ord(i) + n - 26)
    newS.append(new)

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

Solution (Python):
a="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
n=int(input())
S=input()
ans=""
for s in S:
    ans+=a[a.index(s)+n] 
print(ans)

Solution (Python):
l = [chr(c) for c in range(ord('A'), ord('Z')+1)]
N = int(input())
S = list(input())
ans = [l[(l.index(c) + N) % 26] for c in S]
print("".join(ans))

Solution (Python):
from string import ascii_uppercase

uppers = ascii_uppercase + ascii_uppercase
N = int(input())
S = input().strip()

ans = ''
for s in S:
    idx = ascii_uppercase.find(s)
    ans += uppers[idx+N]
print(ans)

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

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

S=[chr(ord(i)+N) if ord(i)+N<=90 else chr(ord(i)+N-26) for i in S]
print("".join(S))

Solution (Python):
n = int(input())
s = list(input())
a = ord("A")
b = ord("Z")
ans = ""
for i in range(len(s)):
    x = ord(s[i])
    x +=n
    if x>b:
        x = x-b+a-1
    ans += chr(x)
print(ans)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n = I()
ans = ''
for i in S():
    if ord(i) + n > 90:
        ans += chr(ord(i) + n - 26)
    else:
        ans += chr(ord(i) + n)


print(ans)

Solution (Python):
n = int(input())
s = input()
t = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

v = []

for c in s:
    for i in range(26):
        if t[i] == c:
            v.append(t[i + n])

print(''.join(v))
exit(0)

Solution (Python):
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy


from itertools import permutations, combinations
from heapq import heappop, heappush

sys.setrecursionlimit(10**8)
mod = 10**9+7
 
def inp(): 
    return int(input())
def inpm(): 
    return map(int,input().split())
def inpl(): 
    return list(map(int, input().split()))
def inpls(): 
    return list(input().split())
def inplm(n): 
    return list(int(input()) for _ in range(n))
def inpll(n): 
    return [list(map(int, input().split())) for _ in range(n)]

def main():
    n=inp()
    s=list(input())
    for i in range(len(s)):
        x = ord(s[i])
        x+=n
        if x>=91:
            x-=26
        s[i]=chr(x)
    print(''.join(s))

if __name__ == "__main__":
    main()

Solution (Python):


import os
import sys


def main():
    N = read_int()
    S = inp()
    print(solve(N, S))


def solve(N, S):
    ans = []
    orda = ord('A')
    for ch in S:
        ans.append(chr((ord(ch) - orda + N) % 26 + orda))

    return ''.join(ans)




DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    letters *= 2
    n = int(input())
    s = input()
    for i in s:
        print(letters[letters.index(i)+n],end = '')
    
main()

Solution (Python):
N = int(input())
S = input()
a = ''
for i in S:
    c = ord(i) + N
    if c > ord('Z'):
        c -= 26
    a += chr(c)
print(a)

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

def b(x):
    return chr((ord(x)-a+N)%26+a)

print(''.join(map(str,map(b,list(S)))))

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

Solution (Python):

N = int(input())
S = input()
S2 = []
for s in S:
    x = ord(s)
    x += N
    if x > 90:
        x -= 26
    S2.append(chr(x))

print(''.join(S2))

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

Solution (Python):
word_list = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
word_list.extend(word_list)
N = int(input())
S = input()
ans = ""
for i in range(len(S)):
    for j in range(len(word_list)):
        if S[i] == word_list[j]:
            ans += word_list[j+N]
            break
print(ans)

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

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

ans=''.join(T)

print(ans)

Solution (Python):
N = int(input())
S = input()
T = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for e in S:
    ans += T[(N+ord(e)-65)%26]
print(ans)

Solution (Python):
N = int(input())
S = input()
S_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for s in S:
    idx = S_list.index(s)+N
    if idx > 25:
        idx -= 26
    ans += S_list[idx]
print(ans)

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

Solution (Python):
N = int(input())
S = input()
h = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
m = {}
for i in range(26):
  c = h[i]
  m[c] = i
L2 = []
for c in S:
  i = m[c]
  i2 = (i+N)%26
  c2 = h[i2]
  L2.append(c2)
print("".join(L2))

Solution (Python):
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
s = input()
ans = ""
for si in s:
  ans += a[(a.index(si)+n) % len(a)]
print(ans)

Solution (Python):
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = input()
d = input()
print("".join([a[(a.index(x)+int(n))%len(a)] for x in d]))

Solution (Python):
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"*2
n = int(input())
for i in input():
    print(alp[alp.index(i)+n], end="")
print()

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def main():
    ids = {}
    for i in range(26):
        ids[alp[i]] = i
    n = ri()
    s = input()
    ans = ""
    for c in s:
        to = (ids[c]+n)%26
        ans += alp[to]
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
S = input()
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = []
for i in range(len(S)):
    ans.append(alpha[(ord(S[i])-65+N)%26])
print(*ans, sep = '')

Solution (Python):
N = int(input())
S = input()
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(len(S)):
    k = alp.find(S[i])
    ans += alp[(k+N)%26]
print(ans)

Solution (Python):
n = int(input())
s = input()
offset = ord('A')
t = [(ord(c) - offset + n) % 26 + offset for c in s]
print(''.join(map(chr, t)))

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

n = int(input())
inp = list(input())
ans = []
for al in inp:
  k = alpha_dict[al]
  k += n 
  if k > 26:
    k -= 26 
  ans += [num_dict[k]]
print(''.join(ans))

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

Solution (Python):
n = int(raw_input())
s = raw_input()
ret = ""

for c in s:
    v = (ord(c) + n)
    if v > ord('Z'):
        v = (v - ord('Z')) + ord('A') - 1
    ret += chr(v)
print ret

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    *S,=ST()
    for i,s in enumerate(S):
        S[i] = chr((ord(s)+N-ord("A"))%26+ord("A"))
    print(*S,sep="")
if __name__ == '__main__':
    main()

Solution (Python):



import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
s = input()
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lst = list(alpha+alpha)
ans = ''
for i in range(len(s)):
    ans += lst[alpha.index(s[i])+n]
print(ans)

Solution (Python):

N = int(input())
S = list(str(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 s in S:
    ans+=A[(A.index(s)+N)%26]
print(ans)

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

ans = ""
for c in S:
  n = ord(c) - ord('A') + N
  if n >= len(AZ):
    n -= len(AZ)
  ans += AZ[n]

print(ans)

Solution (Python):
n=int(input())
s=input()
ans=""
for ss in s:
  k=ord(ss)+n
  if k>=65+26:
    k-=26
  ans+=chr(k)
print(ans)

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

Solution (Python):
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

lists="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lists=list(lists)

max_len=len(lists)

N=one_int()
S=one_str()

N=N%max_len

output=[]
for s in list(S):
    index = lists.index(s)
    output.append(lists[(index+N)%max_len])
print("".join(output))

Solution (Python):
N = int(input())
S = input()
ans = ""
for c in S:
    tmp = ord(c) + N
    if tmp > 90:
        tmp -= 26
    ans += chr(tmp)
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
N = int(input())
S = input()[:-1]

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

Solution (Python):

import sys


def solve(N: int, S: str):
    T = ''
    for s in S:
        T = T + chr((ord(s) + N - ord('A')) % 26 + ord('A'))
    print(T)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    S = next(tokens)  
    solve(N, S)

if __name__ == '__main__':
    main()

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

aslist=[]
for i in range(ng):
    ban=ord(s[i])
    if ban+n>=91:
        ban=ban+n-26
    else:
        ban=ban+n
    aslist.append(ban)

moji=''
for i in range(ng):
    moji+=chr(aslist[i])


print(moji)

Solution (Python):

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


KEY = N


enc = ""

for char in list(S):
    ASCII = ord(char)
    num = ASCII - 65
    num = (num + KEY) % 26
    ASCII = num + 65
    enc += chr(ASCII)

print(enc)

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"]
for x in S:
	i =( L.index(x)+N) % 26
	print(L[i],end="")

Solution (Python):
N = int(input())
S = input()
enc = ""
for char in list(S):
    ASCII = ord(char)
    num = ASCII - 65
    num = (num + N) % 26
    ASCII = num + 65
    enc += chr(ASCII)

print(enc)

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):
chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

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

print(''.join(chars[(chars.index(i) + n) % 26] for i in s))

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

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

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

print ()

Solution (Python):
n=int(input())
s=input()
alp=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
ans=""
for c in s:
    ans+=alp[(alp.index(c)+n) % 26]

print(ans)

Solution (Python):
N = int(input())
s = input()
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)

result = caesar(s, N)
print(result)

Solution (Python):
N = int(input())
s = input()
ls = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ret=[]
for i in range(len(s)):
    ret.append(ls[(ls.index(s[i])+N)%26])
print(''.join(ret))

Solution (Python):
n=int(input())
s=input()
ans=''
ss='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in s:
    x=ss.index(i)
    ans+=ss[x+n]
print(ans)

Solution (Python):
ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = input()
table = str.maketrans(ALPHA, ALPHA[N:] + ALPHA[:N])
result = S.translate(table)
print(result)

Solution (Python):

from collections import defaultdict


def getlist():
	return list(map(int, input().split()))


def main():
	N = int(input())
	S = list(input())
	M = len(S)
	for i in range(M):
		S[i] = chr((ord(S[i]) - 65 + N) % 26 + 65)
	print("".join(S))








if __name__ == '__main__':
	main()

Solution (Python):
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

N = int(input())
ans = []

for s in input():
    idx = alp.index(s) 
    
    ans.append(alp[(idx+N)%26])
    
print(''.join(ans))

Solution (Python):
def main():
    N = int(input())
    S = input()
    ans = [None] * len(S)
    for i in range(len(S)):
        c = S[i]
        x = (ord(c) - ord("A") + N) % 26 + ord("A")
        ans[i] = chr(x)
    print("".join(ans))


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
S = input()
character = list('abcdefghijklmnopqrstuvwxyz'.upper()) * 2

answer = []
for i in S:
    answer.append(character[character.index(i) + N])

print(''.join(answer))

Solution (Python):

import sys


def solve(N: int, S: str):
    alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

    answer = ""
    for s in S:
        index = alpha.index(s)
        new_index = (index+N)%26
        answer+=alpha[new_index]
    print(answer)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    S = next(tokens)  
    solve(N, S)

if __name__ == '__main__':
    main()

Solution (Python):

N = int(input())
S = input()
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = []
for i in range(len(S)):
    ans.append(letters[letters.index(S[i]) + N])
print("".join(ans))

Solution (Python):
n = int(input())
s = str(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=list(input())

for i in range(len(s)):
    x=ord(s[i])+n
    if x>ord("Z"):
        x-=ord("Z")
        x+=ord("A")-1
    s[i]=chr(x)
print("".join(s))

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

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

Solution (Python):
cha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
s = input()
a = ''
for i in s:
  ind = cha.index(i)
  ind = (ind + n) % 26
  a += cha[ind]
print(a)

Solution (Python):
from operator import mul
from functools import reduce
from collections import Counter


















import sys

sys.setrecursionlimit(2000)


def inpl():
    return list(map(int, input().split()))



def cmb(n, r):
    
    if n < r:
        return 0
    r = min(n - r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


def gcd(a, b):
    
    while b > 0:
        a, b = b, a % b

    return a


def lcm(a, b):
    
    return a * b // gcd(a, b)


al = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

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

for i, s in enumerate(S):
    j = al.index(s)
    S[i] = al[(j + N) % 26]

print("".join(S))

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    S=list(input())
    S=list(map(ord,S))
    for i in range(len(S)):
        s=S[i]
        S[i]=65+(s+n-65)%26
    S=list(map(chr,S))
    print(''.join(S))
resolve()

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

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

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

print("".join(s))

Solution (Python):
KEY = int(input())
PLAIN = input().lower()

enc = ""

for char in list(PLAIN):
    ASCII = ord(char)
    num = ASCII - 97
    num = (num + KEY) % 26
    ASCII = num + 97
    enc += chr(ASCII)

print(enc.upper())

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

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

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    s = str(readline().rstrip().decode('utf-8'))
    al = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    ans = []
    for i in range(len(s)):
        for j in range(len(al)):
            if s[i] == al[j]:
                ans.append(al[(j+n) % 26])
                break
    print("".join(ans))


if __name__ == '__main__':
    solve()

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

L = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

ans = ''
for i in range(len(S)):
    ans += L[L.index(S[i])+N]
print(ans)

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

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

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

ans = ""

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

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

for i, x in enumerate(s):
    temp = ord(x) - ord('A')
    temp = (temp + n) % 26
    s[i] = chr(ord('A') + temp)

print(''.join(s))

Solution (Python):
words = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
s = input()
ans = ""
for w in s:
    ans += words[(n+words.index(w))%26]
print(ans)

Solution (Python):

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    return


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

    N %= 26

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

if __name__ == '__main__':
    main()

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return 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']


def main():
  n=I()
  s=S()

  ans=''
  for x in s:
    t=l.index(x)
    ans+=l[(t+n)%26]
  return ans


print(main())

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

T="ABCDEFGHIJKLMNOPQRSTUVWXYZ"*3

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

print("".join(S))

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

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

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

print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n=int(input())
    s=input()
    ans="".join(chr((ord(c)-65+n)%26+65) for c in s)
    print(ans)
main()

Solution (Python):
N = int(input())
S = input()
ans = ''
for s in S:
    s_ = ord(s)+N
    if(s_>90):
        s_ = s_-90+64
    ans += chr(s_)
print(ans)

Solution (Python):
n = input()
print ''.join(map(lambda c: chr((ord(c) - ord('A') + n) % 26 + ord('A')), raw_input()))

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