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 solve(N: int, S: str):
    answer = ""
    for s in S:
        answer += chr(65 + (ord(s) - 65 + N) % 26)
    return answer


def main():
    N = int(input())
    S = input().strip()
    answer = solve(N, S)
    print(answer)


if __name__ == "__main__":
    main()

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

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

    answer = ''
    for letter in s:
        answer += chr(ord('A') + (ord(letter)-ord('A')+n) % 26)

    print(answer)


if __name__ == '__main__':
    rot_n()

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

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

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

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

l = string.ascii_uppercase
ans = [l[(l.index(i) + n ) % len(l)] for i in s]
print(''.join(ans))

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

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

print("".join(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():
    N = int(input())
    S = input()
    ans = ""
    for c in S:
        v = ord(c) - ord("A")
        ans += chr(ord("A") + ((v + N) % 26))
    print(ans)


def main():
    solve()


if __name__ == '__main__':
    main()

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

Solution (Python):
from string import ascii_uppercase

n = int(input())
s = input()
uu = ascii_uppercase*3

d = {}
for i in range(27):
    d[uu[i]] = uu[i+n]

ans = ""
for c in s:
    ans += d[c]

print(ans)

Solution (Python):
a = [chr(i) for i in range(65, 65+26)]
n = int(input())
s = input()
ans = ''
for i in s:
    ans += (a[(a.index(i)+n)%26])
print(ans)

Solution (Python):
N = int(input())
S = input()
T = ''
for i in S:
    if (ord(i)-64+N)%26 != 0:
        T += chr((ord(i)-64+N)%26 + 64)
    else:
        T += 'Z'
print(T)

Solution (Python):
from functools import reduce

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

ans = [chr(ord("A") + (ord(s) + N - ord("A"))%26) for s in S]

ans = reduce(lambda x, y: x + y, ans)

print(ans)

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

Solution (Python):
A = int(input())
a = list(input())
s = ''
for i in a:
  
  k = (ord(i)+A-65)%26
  s += chr(k+65)
  

print(s)

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

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

ans=""
for x in S:
  if ord("Z")<ord(x)+N:
    ans+=chr(ord(x)+N-26)
  else:
    ans+=chr(ord(x)+N)

print(ans)

Solution (Python):
from string import ascii_uppercase as au

N = int(input())
S = input()
ans = ''
for s in S:
	idx = (au.index(s) + N) % len(au)
	ans += au[idx]
print(ans)

Solution (Python):
num_a = ord("A")
num_z = ord("Z")

N = int(input())
S = input()
ans = ""
for char in S:
  tmp = N + ord(char)
  if tmp > num_z:
    ans += chr(tmp-26)
  else:
    ans += chr(tmp)
print(ans)

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


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

print(answer)

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

for i in s:
    ascii_code = (ord(i) + n)
    if ascii_code >= 91:
        ascii_code -= 26

    ans += chr(ascii_code)

print(ans)

Solution (Python):
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq

n = ni()
s = input()
def wid(w):
    return ord(w)-ord("A")
def ws(wid):
    return chr(wid+ord("A"))
ans = ""
for i in range(len(s)):
    id = (wid(s[i])+n)%26
    ans+=ws(id)
print(ans)

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

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

    ans = ""

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def f(s, n):
    ans = ''
    for c in s:
        ans += chr(ord('A') + (ord(c)-ord('A')+n) % 26)
    return ans

N = int(input())
S = input()
print(f(S, N))

Solution (Python):
def rot_n(s, n):
  answer = ''
  for letter in s:
      answer += chr(ord('A') + (ord(letter)-ord('A')+n) % 26)

  return answer



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

print(rot_n(S, N))

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

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

print(''.join(s))

Solution (Python):
N=int(input())
S=input()
T="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for c in S:
    print(T[(T.index(c)+N)%26],end='')
print()

Solution (Python):
a=int(input())
b=input()
c=[]
d=[]
e=""
for i in range(len(b)):
  c.append(ord(b[i]))
for i in range(len(b)):
  d.append((int(c[i])+a-65)%26+65)
for i in range(len(b)):
  e=e+chr(d[i])
print(e)

Solution (Python):
N = int(input())
S = input()
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in S:
    print(abc[(abc.index(i)+N)%len(abc)], end = "")

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

node = input()
table = list(node)


for i in table:
    aaa = ord('A') + ((ord(i) - (ord('A')) + num) % 26)
    print(chr(aaa), end='')

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

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

mozi = ["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:
  number = mozi.index(x) + n
  if number > 25:
    number = number - 26
  print(mozi[number], end="")

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

ans = ''
Z_s = 'Z'
for i in range(len(S)):
    ord_s = ord(S[i]) + N
    if ord_s > ord(Z_s):
        ord_s -= ord('Z') - ord('A') + 1
    ans += chr(ord_s)
print(ans)

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 = input()
ans = ''
for i in range(len(s)):
    if ord(s[i])+n>90:
        ans  += chr(ord(s[i])+n-26)
    else:
        ans  += chr(ord(s[i])+n)
print(ans)

Solution (Python):

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

alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans=""
for i in range(len(S)):
    for j in range(26):
        if alpha[j]==S[i]:
            index=(j+N)%26
            ans+=alpha[index]
            break
print(ans)

Solution (Python):
import string

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


a = string.ascii_uppercase


ans = ''
for s in S:
  num = (a.index(s) + N) % len(a)
  ans += a[num]
  
print(ans)

Solution (Python):
import string

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

a = string.ascii_uppercase


ans = ''
for s in S:
  ans += a[(a.index(s) + N) % len(a)]
  
print(ans)

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

a = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
ans = ''
for s in S:
  num = a.index(s) + N
  if num <= 25: ans += a[num]
  else: ans += a[num-26]
  
print(ans)

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

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

Solution (Python):


n=int(input())

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

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

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

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

Solution (Python):
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

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

ans = []
for c in S:
    print(abc[(abc.index(c) + N) % len(abc)], end = "")

Solution (Python):
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

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

ans = []
for c in S:
    print(abc[(abc.index(c) + N) % len(abc)], end = "")

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

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

for i in s:
    ind = al.index(i) + n
    ans += al[ind % 26]

print(ans)

Solution (Python):
n=int(input())
s=list(input())
ans=[]
for i in range(len(s)):
  a=int(((ord(s[i])+n)%65)%26)
  ans.append(chr(a+65))

print(''.join(ans))

Solution (Python):
n = int(input())
list_s = list(input())
for i in range(0, len(list_s)):
    tmp = ord(list_s[i]) + n
    if tmp > ord("Z"):
        tmp -= 26
    list_s[i] = chr(tmp)
print("".join(list_s))

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

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

print(ans)

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

abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' * 2
ans = ''
for i in s:
    ans += abc[abc.index(i)+n]
print(ans)

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

Solution (Python):
n=int(input())
s=input()
a="abcdefghijklmnopqrstuvwxyz".upper()*2

for i in s:
    b=a[a.index(i)+n]
    print(b,end="")

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"]
N = int(input())
S = input()
ans = ""
for i in range(len(S)):
  x = alphabet.index(S[i])
  if x + N >= 26:
    y = x + N -26
  else:
    y = x + N
  ans += alphabet[y]
print(ans)

Solution (Python):
N=int(input());print("".join(map(lambda x:chr((ord(x)-65+N)%26+65),input())))

Solution (Python):
N = int(input())
S = input()
T = ""
char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
char2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(S)):
    for j in range(26):
        if S[i] == char[j]:
            T += char2[j + N]
            break
print(T)

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 1
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()


n = k()
S = list(v())

for i in range(len(S)):
    a = AL.index(S[i])
    ans = a+n
    if ans >= 26:
        ans = (a+n)-26
    S[i] = AL[ans]

print("".join(S))

Solution (Python):
ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

n = int(input())
S = input()
for s in S:
    print(ALP[ALP.index(s)+n],end='')

Solution (Python):

def calc_digit_sum(num):
    digits = sums = 0
    while num > 0:
        digits += 1
        sums += num % 10
        num //= 10
    return digits, sums


n = int(input())
s = [((ord(ch) - 65 + n) % 26) + 65 for ch in input()]
print("".join(map(chr, s)))

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

abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Sn = ""
for i in range(len(S)):
  Sn += abc[(abc.find(S[i])+N) % 26]
print(Sn)

Solution (Python):
import string
N = int(input())
S = input()
ascii_uppercase = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
for s in S:
    s_index = ascii_uppercase.index(s)
    ans_index = (s_index + N) % len(ascii_uppercase)
    print(ascii_uppercase[ans_index], end="")

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


for i in range(len(S)):
    S[i] = ord(S[i])

for i in range(len(S)):
    if S[i] + N <= 90:
        S[i] = chr(S[i] + N)
    else:
        S[i] = chr(64 + S[i] + N - 90)


S = ''.join(S)
print(S)

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

for i in range(len(s)):
    for j in range(26):
        if s[i] == alp[j]:
            s[i] = alp[j+n]
            break

print(''.join(s))

Solution (Python):
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"]
n=int(input())
s=str(input())
t=""
for i in range(len(s)):
  for j in range(26):
    if s[i]==A[j]:
      if j+n<=25:
        t+=A[j+n]
        break
      else:
        t+=A[j+n-26]
        break

print(t)

Solution (Python):


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

res = ''

for letter in s:
    res += chr(ord('A') + (ord(letter)-ord('A')+n) % 26)

print(res)

Solution (Python):
n = int(input())
s = input()
t = ""
for i in s:
  a = ord(i) + n
  if a > ord("Z"):
    a = a - 26
  t += chr(a)
print(t)

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

Solution (Python):
n=int(input())
print(*[chr(65+(ord(a)+n-65)%26) for a in input()], sep='')

Solution (Python):
N = int(input())
S = input()
revALPH = "".join(list(reversed("ABCDEFGHIJKLMNOPQRSTUVWXYZ")))
A = ""

for s in S:
    pos = revALPH.find(s)
    A += revALPH[pos - N]

print(A)

Solution (Python):
alpha = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = list(input())
for i in S:
  idx = alpha.index(i)
  n_idx = (idx + N) % 26
  print(alpha[n_idx],end="")

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

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





for i in range(len(S)):
	ascii = ord(S[i]) + N   
	if ascii > ord("Z"):    
		ascii = ascii - (ord("Z") - ord("A") + 1)
	print(chr(ascii),end = "")

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from string import ascii_uppercase

    N = int(readline())
    S = input()
    res = ""

    for char in S:
        idx = ascii_uppercase.index(char)
        res += ascii_uppercase[(idx + N) % 26]

    print(res)

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
N=int(input())
S=list(map(str, input()))
li=['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']
answer=[]
for i in range(len(S)):
  for j in range(len(li)):
    if S[i]==li[j] and j<len(li)-N:
      answer.append(li[j+N])
    elif S[i]==li[j] and j>=len(li)-N:
      answer.append(li[j+N-len(li)])
print("".join(answer))

Solution (Python):
N = int(input())
S = input()
newS = ''
A = ord('A')
Z = ord('Z')
for k in range(len(S)):
    if ord(S[k]) + N > Z:
        newS += chr(ord(S[k]) + N - Z + A - 1)
    else:
        newS += chr(ord(S[k]) + N)
print(newS)

Solution (Python):

from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify

import itertools
import math, fractions
import sys, copy

def L(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline().rstrip())
def SL(): return list(sys.stdin.readline().rstrip())
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def R(n): return [sys.stdin.readline().strip() for _ in range(n)]
def LR(n): return [L() for _ in range(n)]
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def LIR1(n): return [LI1() for _ in range(n)]
def SR(n): return [SL() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]

def perm(n, r): return math.factorial(n) // math.factorial(r)
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))

def make_list(n, *args, default=0): return [make_list(*args, default=default) for _ in range(n)] if len(args) > 0 else [default for _ in range(n)]

dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
alphabets = "abcdefghijklmnopqrstuvwxyz"
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
MOD = 1000000007
INF = float("inf")

sys.setrecursionlimit(1000000)

def main():
    N = I()
    S = SL()

    for ch in S:
        print(ALPHABETS[(ALPHABETS.find(ch) + N) % len(ALPHABETS)], end="")
    print()

if __name__ == '__main__':
    main()

Solution (Python):


from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, S: str):
    return "".join(chr((ord(c) - ord('A') + N) % 26 + ord('A')) for c in S)


def main():

    sys.setrecursionlimit(10 ** 6)

    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)  
    print(f'{solve(N, S)}')


if __name__ == '__main__':
    main()

Solution (Python):
import string

N=int(input())
S=input()
A=string.ascii_letters.upper()

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

Solution (Python):
data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"



n=int(input())
a=input()
ans=""
for i in a:
  p = (ord(i)-65+n)%26
  ans+=data[p]
print(ans)

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

S = input()
s = list(S)
l = len(s)



B = []

for i in range(l):
  c = ord(s[i])
  e = c+N
  if e>ord('Z'):
    e = e - 26
  d = chr(e)
  B.append(d)
    
b = ''.join(B)

print(b)

Solution (Python):
word = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
s = input()
answer = ''
for i in range(len(s)):
    iti = word.find(s[i])
    if iti + n + 1 > len(word):
        answer += word[iti+n-len(word)]
    else:
        answer += word[iti+n]
print(answer)

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

A = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

T = str.maketrans(A, A[N:] + A[:N])

print(S.translate(T))

Solution (Python):
n = int(input())
s = input()
x = len(s)
for i in range(x):
  a = s[i]
  b = ord(a)
  c = ord("A")
  d = (b + n - c)%26
  print(chr(c + d), end = '')
print()

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

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

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

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

print(ans)

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

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

print(res)

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

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

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

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

S = input()
T  = ''
for s in S:
    T+=(chr(ord('A')+(ord(s)-ord('A')+n)%26))
print(T)

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

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

    print(*s, sep="")


if __name__ == "__main__":
    main()

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

ans = []
for i in range(len(s)):
    for j in range(len(alpha)):
        if s[i] == alpha[j]:
                ans.append(alpha[(j+n)%26])
print("".join(ans))

Solution (Python):
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
s = input()
ans = []
for i in range(len(s)):
    for j in range(len(alpha)):
        if s[i] == alpha[j]:
            if j+n<25:
                ans.append(alpha[j+n%26])
            else:
                ans.append(alpha[n%26-(26-j)])
print("".join(ans))

Solution (Python):
N = int(input())
S = input()
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
result = ''
for i in S:
    ind = A.index(i)
    ind += N
    if ind > 25:
        ind -= 26
    result += A[ind]
print(result)

Solution (Python):
N = int(input())
S = input()
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
T = ''
for i in S:
	ind = A.index(i)
	ind += N
	if ind > 25:
		ind -= 26
	T += A[ind]
print(T)

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

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

print(S)

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

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

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

l = []
for i in S:
    if ord(i)+N > 90:
        l.append(chr(64+(ord(i)+N)%90))
    else:
        l.append(chr(ord(i)+N))

print("".join(l))

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

ans=""

for i in range(len(s)):
    num=ord(s[i])+n
    if num>90:
        num-=26
    ans+=chr(num)
print(ans)

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    N = I()
    S = _S()
    alpha = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    ans = ""
    for s in S:
        ind = (alpha.index(s)+N) if (alpha.index(s)+N)<26 else (alpha.index(s)+N)-26
        ans += alpha[ind]
    print(ans)


main()

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

tmp = []
for s in S:
    if ord(s)+n > ord('Z'):
        tmp.append(ord('A')+(ord(s)+n)%ord('Z')-1)
    else:
        tmp.append(ord(s)+n)

ans = ''
for i in tmp:
    ans += chr(i)
print(ans)

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

Solution (Python):
ali = []
for i in range(52):
    if i <= 25:
        ali.append(chr(ord("A")+i))
    else:
        ali.append(chr(ord("A")+i-26))

n = int(input())
s = input()
news = ""
for i in range(len(s)):
    news += ali[ali.index(s[i]) + n]
print(news)

Solution (Python):
n=int(input())
a=input()
L=[]
for i in range(26):
    L.append(chr(65+i))
news=''
for i in range(len(a)):
    if L.index(a[i])+n>25:
        news+=L[L.index(a[i])+n-26]
    else:
        news+=L[L.index(a[i])+n]
        



print(news)

Solution (Python):
n=int(input())
a=input()
L=[]
for i in range(26):
    L.append(chr(65+i))
news=''
for i in range(len(a)):
  news+=L[L.index(a[i])+n-26]
print(news)

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

plus = N % 26
result = ''
for c in S:
    next = ord(c) + plus
    result += chr(next - 26) if next > 90 else chr(next)
print(result)

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
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(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
S = input()
tmp = string.ascii_uppercase

ans = []
for s in S:
    i = string.ascii_uppercase.index(s)
    if i+n > 25:
        ans.append(tmp[i+n-26])
    else:
        ans.append(tmp[i+n])

print(''.join(ans))

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

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

l=[]

for a in s:
  moji=ord(a)
  moji+=n

  if int(moji)>90:
    moji-=26

  l.append(chr(moji))

print(''.join(l))

Solution (Python):
N=int(input())
S=input()
L=list(S)
A=len(L)
S=[]
for i in range(A):
  if (ord(L[i])+N)>90:
    S.append(chr(ord(L[i])+N-26))
  else:
    S.append(chr(ord(L[i])+N))
    
print(''.join(S))

Solution (Python):


n = int(input())
s = str(input())
new = []

ntr = n % 26

for p in range(len(s)):
    k = ord(s[p]) + ntr
    if k > 90:
        k = k - 90 + 64
    new.append(chr(k))

x = "".join(new)
print(x)

Solution (Python):
import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

for i in range(len(s)):
    ss=chr((ord(s[i])+n-ord('A'))%26+ord('A'))
    s[i]=ss
print("".join(s))

Solution (Python):
n = int(input())
s = str(input())
w = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
t = ""
for i in range(len(s)):
    for h in range(26):
        if s[i] == w[h]:
            t += w[h+n]
            break
print(t)

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

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

ans = ''
for si in s:
    num = ord(si)+n
    if num > ord('Z'):
        ans += chr(num-26)
    else:
        ans += chr(num)
print(ans)

Solution (Python):
N = int(input())
S = list(input())
L = [chr(ord("A")+i) for i in range(26)]
X = ""
for i in S:
    a = L.index(i) + N
    if a >= 26:
        a = a - 26
        X += L[a]
    else:
        X +=  L[a]
print(X)

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy








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(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
s = input()
ans = ''
for t in s:
    st = ord(t) + n
    if(st > ord('Z')):
        st = ord('A') + st - ord('Z') - 1
    ans = ''.join([ans, chr(st)])
print(ans)

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

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

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

print(ans)

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

for i in range(len(s)):
    if ord(s[i])+N-ord('A') < 26:
        s[i] = chr(ord(s[i])+N)
    else:
        s[i] = chr(ord(s[i])+N-26)
print(''.join(s))

Solution (Python):
n=int(input())
s=input()
l=[]
for i in s:
    x=(ord(i)-65+n)%26
    y=chr(65+x)
    l.append(y)
print(''.join(l))

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

alphabet = 'abcdefghijklmnopqrstuvwxyz'
alphabet = alphabet.upper()
alphabets = [w for w in alphabet]

words = []
for i in s:
    index = alphabets.index(i)
    new_index = index + n
    if new_index > 25:
        new_index -= 26
    words.append(alphabets[new_index])

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

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

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


num2alpha = lambda c: chr(c+64)

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

ans = [0] * len(S)
for i in range(len(S)):
  now = alpha2num(S[i]) + N
  now %= 26
  ans[i] = num2alpha(now + 1)
  
for i in range(len(S)):
  print(ans[i], end = "")

Solution (Python):
n = int(input())
s = input()
abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''

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