AtCoder Beginner Contest 146 - ROT N

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-----
2
ABCXYZ

-----Sample Output-----
CDEZAB

Note that A follows Z.

Difficulty: EASY

Starter code:

Solutions:
N = int(input())
S = input()
ls = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
lsS = list(S)
lsans = []
for i in range(len(S)):
	lsans.append(ls[(ls.index(lsS[i]) + N) % 26])
print(''.join(lsans))


n = int(input())
s = input()
a = 'abcdefghijklmnopqrstuvwxyz'.upper() * 2
for i in s:
	b = a[a.index(i) + n]
	print(b, end='')


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


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)


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


n = int(input())
s = input()
t = [chr((ord(s[i]) - 65 + n) % 26 + 65) for i in range(len(s))]
print(''.join(t))


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


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


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


def answer(n: int, s: str) -> str:
	result = []
	A = ord('A')
	for i in s:
		result.append(chr(A + (ord(i) - A + n) % 26))
	return ''.join(result)

def main():
	n = int(input())
	s = input()
	print(answer(n, s))

def __starting_point():
	main()
__starting_point()


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


n = int(input())
s = input()
lst = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
ans = ''
for i in range(len(s)):
	ans += lst[(lst.index(s[i]) + n) % 26]
print(ans)


N = int(input())
S = input()
ss = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for s in S:
	ans += ss[ss.index(s) + N]
print(ans)


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


N = int(input())
S = input()
T = [chr((ord(s) - 65 + N) % 26 + 65) for s in S]
print(''.join(T))


N = int(input())
print(''.join([chr((ord(m) - 65 + N) % 26 + 65) for m in input()]))


n = int(input())
s = input()
a = ord('A')
for i in s:
	print(chr((ord(i) - a + n) % 26 + a), end='')


n = int(input())
s = input()
t = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ' * 2)
a = ''
for i in s:
	a += t[t.index(i) + n]
print(a)


n = int(input())
S = input()
print(''.join((chr(65 + (ord(s) - 65 + n) % 26) for s in S)))


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


import sys
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inl = lambda : [int(x) for x in sys.stdin.readline().split()]
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))

def solve():
	n = ini()
	s = ins()
	ans = []
	for c in s:
		x = chr((ord(c) - ord('A') + n) % 26 + ord('A'))
		ans.append(x)
	return ''.join(ans)
print(solve())


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


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)


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


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


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


N = int(input())
l = input()
for i in range(len(l)):
	print(chr((ord(l[i]) + N - 65) % 26 + 65), end='')


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)


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


n = int(input())
s = list(input())
ans = []
for e in s:
	od = ord(e) + n
	if od > 90:
		od = 64 + od - 90
	ans.append(chr(od))
print(''.join(ans))


N = int(input())
S = input()
for c in S:
	k = ord(c) + N
	print(chr((k, k - 26)[k > ord('Z')]), end='')


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


N = int(input())
S = input()
ans = [chr((ord(i) - 65 + N) % 26 + 65) for i in S]
print(''.join(ans))


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)


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='')


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)


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


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)


n = int(input())
s = input()
l = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' * 2
S = ''
for i in s:
	S += l[l.index(i) + n]
print(S)


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


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


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


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


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


N = int(input())
S = input()
r = ''
for i in range(len(S)):
	r = r + chr((ord(S[i]) + N - 65) % 26 + 65)
print(r)


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


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


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)

def __starting_point():
	rot_n()
__starting_point()


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='')


n = int(input())
print(''.join([chr((ord(i) - 65 + n) % 26 + 65) for i in input()]))


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


N = int(input())
print(''.join(map(lambda c: chr((c + N - 65) % 26 + 65), map(ord, input()))))


N = int(input())
print(''.join(map(lambda s: chr((ord(s) - ord('A') + N) % 26 + ord('A')), input())))


n = int(input())
a = input()
b = ''
for i in a:
	x = ord(i) + n
	if x > 90:
		x = x - 26
	b = b + chr(x)
print(b)


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


N = int(input())
S = list(input())
L = [chr(x) for i in range(2) for x in range(65, 65 + 26)]
for s in S:
	ind = L.index(s)
	print(L[ind + N], end='')
print('')


N = int(input())
S = input()
T = ''
for i in S:
	T = T + chr((ord(i) - 65 + N) % 26 + 65)
print(T)


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


N = int(input())
S = input()
print(bytes(((s - 65 + N) % 26 + 65 for s in S.encode())).decode())


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


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)


n = int(input())
s = input()
print(''.join([chr(ord(c) + n - 26 * (ord(c) + n > 90)) for c in s]))


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


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


shift = int(input())
print(''.join((chr(ord('A') + (ord(c) - ord('A') + shift) % 26) for c in input())))


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


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


N = int(input())
s = input()
base = ord('A')
print(''.join([chr(base + (ord(c) - base + N) % 26) for c in s]))


N = int(input())
S = input()
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for word in S:
	index = alphabet.index(word)
	new_index = (index + N) % 26
	ans = ans + alphabet[new_index]
print(ans)


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


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)


N = int(input())
S = input()
print(''.join(list(map(lambda x: chr((ord(x) - ord('A') + N) % 26 + ord('A')), S))))


N = int(input())
S = list(input())
alp = [chr(i) for i in range(65, 65 + 26)] * 2
for j in S:
	num = alp.index(j)
	print(alp[num + N], end='')


W = {'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': 0}
n = int(input())
A = input()
ans = ''
for i in A:
	for (j, k) in W.items():
		if k == (W[i] + n) % 26:
			ans += j
print(ans)


N = int(input())
S = input()
lst = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
dct1 = {}
dct2 = {}
ans = []
for (i, j) in enumerate(lst, 1):
	dct1[j] = i
	dct2[i] = j
for s in list(S):
	n = dct1[s] + N
	if n >= 27:
		n -= 26
	m = dct2[n]
	ans.append(m)
print(''.join(ans))


N = int(input())
S = input()
print(''.join((chr((ord(c) - 65 + N) % 26 + 65) for c in S)))


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


A = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
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)


n = int(input())
s = input()
ans = [chr((ord(e) - 65 + n) % 26 + 65) for e in s]
print(''.join(ans))


n = int(input())
s = input()
for s_i in s:
	print(chr((ord(s_i) + n + 65) % 26 + 65), end='')


n = int(input())
s = input()
ss = ''
for m in s:
	l = (ord(m) + n - 65) % 26 + 65
	ss += chr(l)
print(ss)


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


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


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


N = int(input())
S = input()
c = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
ans = ''
for i in range(len(S)):
	ans += c[(c.index(S[i]) + N) % 26]
print(ans)
return


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


l = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
L = []
n = int(input())
s = input()
for i in range(len(s)):
	L.append(l[(l.index(s[i]) + n) % 26])
L = ''.join(L)
print(L)


key = int(input())
s = input()
for x in s:
	print(chr((ord(x) - 65 + key % 26) % 26 + 65), end='')


n = int(input())
s = list(input())
abc = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
for i in range(len(s)):
	for j in range(len(abc)):
		if s[i] == abc[j]:
			s[i] = abc[j + n]
			break
print(''.join(s))


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


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


n = int(input())
print(''.join([chr((n + ord(x), n + ord(x) - 26)[ord(x) > 90 - n]) for x in input()]))


l = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' * 2
n = int(input())
print(''.join([l[l.index(x) + n] for x in input()]))


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


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)

def __starting_point():
	main()
__starting_point()


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)


n = int(input())
print(*[chr(ord(i) + n + [0, -26][ord(i) + n > 90]) for i in input()], sep='')


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

def change():
	s = []
	for i in range(len(S)):
		m = (ord(S[i]) - ord('A') + N) % 26
		s.append(chr(m + ord('A')))
	return ''.join(s)
print(change())


n = int(input())
s = input()
a = ''
for c in s:
	o = ord(c) + n
	if o > 90:
		o -= 26
	a += chr(o)
print(a)


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


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


n = int(input())
s = input()
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
	print(alp[alp.index(s[i]) + n], end='')
print()


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


al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = list(input())
for i in range(len(S)):
	S[i] = al[al.index(S[i]) + N]
print(''.join(S))


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)


def main():
	N = int(input())
	S = input()
	res = ord('A')
	ans = ''
	for s in S:
		ans += chr(res + (ord(s) - res + N) % 26)
	print(ans)

def __starting_point():
	main()
__starting_point()


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


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


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


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)


n = int(input())
s = input()
print(*[chr(65 + (ord(si) - 65 + n) % 26) for si in s], sep='')


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)


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

def __starting_point():
	main()
__starting_point()


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


n = int(input())
s = input()
w_n = n % 26
print(''.join([chr(65 + (ord(w) - 65 + w_n) % 26) for w in s]))


n = int(input())
s = list(input())
for a in range(len(s)):
	s[a] = chr(ord(s[a]) + n)
	if ord(s[a]) > 90:
		s[a] = chr(ord(s[a]) - 26)
c = s[0]
for b in range(len(s) - 1):
	c = c + s[b + 1]
print(c)


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)


k = input()
l = input()
a1 = []
for i in l:
	n = (ord(i) - 65 + int(k)) % 26 + 65
	a1.append(chr(n))
a1 = ''.join(a1)
print(a1)


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


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)


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='')


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


n = int(input())
s = input()
for i in s:
	c = ord(i) + n
	if c >= 91:
		c = c - 26
	print(chr(c), end='')
print()


n = int(input())
s = input()
l = len(s)
t = ''
for i in range(l):
	tmp = (ord(s[i]) - 65 + n) % 26 + 65
	t += chr(tmp)
print(t)


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)


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


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)


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


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


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


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


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)


N = int(input())
S = input()
answer = ''
for x in S:
	x = chr(ord(x) + N)
	if ord(x) > ord('Z'):
		x = chr(ord('A') + (ord(x) - ord('Z') - 1))
	answer += x
print(answer)


import numpy as np
N = int(input())
S = input()
base_ascii = 65
als = [chr(a) for a in range(65, 90 + 1)]
ascii_S = np.array(list(map(ord, S))) - base_ascii
print(''.join([als[np.mod(s + N, len(als))] for s in ascii_S]))


n = int(input())
print(''.join(list(map(lambda x: chr(65 + (ord(x) - 65 + n) % 26), list(input())))))


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


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)


t = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' * 2
n = int(input())
ans = ''
for i in input():
	ans += t[t.index(i) + n]
print(ans)


n = int(input())
s = list(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', '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']
li1 = []
for i in s:
	li1.append(li[li.index(i) + n])
print(''.join(li1))


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


n = int(input())
s = input()
for x in s:
	st = (ord(x) + n - 65) % 26
	print(chr(65 + st), end='')


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


N = int(input())
S = input()
for i in S:
	d = ord(i)
	d += N
	if d > 90:
		d -= 26
	i = chr(d)
	print(i, end='')


n = int(input())
s = list(str(input()))
for i in range(len(s)):
	ns = ord(s[i]) - 64
	print(chr((ns + n - 1) % 26 + 65), end='')


k = int(input())
msg = input()
for it in msg:
	print(chr(ord('A') + (ord(it) - ord('A') + k) % 26), end='')
print()


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)


n = int(input())
s = list(input())
for l in s:
	m = (ord(l) - 65 + n) % 26 + 65
	j = chr(m)
	print(j, end='', sep='')


N = int(input())
S = input()
code_A = ord('A')
results = ''
for c in S:
	after_n = (ord(c) + N - code_A) % 26
	results += chr(code_A + after_n)
print(results)


n = int(input())
print(*[chr(ord(i) + n) if ord(i) + n <= 90 else chr(ord(i) + n - 26) for i in input()], sep='')


c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
a = int(input())
print(''.join([c[(c.index(i) + a) % 26] for i in input()]))


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


N = int(input())
s = ''.join((chr((ord(x) + N - 65) % 26 + 65) for x in input()))
print(s)


n = int(input())
s = input()
al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in s:
	ind = al.index(i) + n
	ans += al[ind % 26]
print(ans)


N = int(input())
S = input()
for i in range(len(S)):
	print('{}'.format(chr(65 + (ord(S[i]) - 65 + N) % 26)), end='')


N = int(input())
S = str(input())
T = ''
for i in range(len(S)):
	T += chr(65 + (ord(S[i]) + N - 65) % 26)
print(T)


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


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


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


import string
abc = list(string.ascii_uppercase)
n = int(input())
s = list(input())
for i in range(len(s)):
	x = abc.index(s[i])
	s[i] = abc[(x + n) % 26]
print(''.join(s))


n = int(input())
s = input()
for i in s:
	k = ord(i) + n
	print(chr(k - (k > ord('Z')) * 26), end='')


n = int(input())
S = input()
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' * 2
T = ''
for s in S:
	T += A[A.index(s) + n]
print(T)


def main():
	N = int(input())
	S = input()
	S = list(S)
	size = len(S)
	for i in range(size):
		num = ord(S[i]) + N
		if num > 90:
			num -= 26
		S[i] = chr(num)
	for (i, item) in enumerate(S):
		print(item, end='')
	print('')

def __starting_point():
	main()
__starting_point()


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


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


n = int(input())
C = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for c in input():
	print(C[(C.find(c) + n) % 26], end='')
print()


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


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)


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


n = int(input())
print(''.join([chr(i + n) if i + n < 91 else chr(i + n - 26) for i in map(ord, list(input()))]))


import numpy as np
N = int(input())
S = input()
ascii_S = np.array(list(map(ord, S))) - 65
shift_ascii_S = list(map(lambda x: 65 + np.mod(x + N, 26), ascii_S))
shift_S = ''.join(list(map(chr, shift_ascii_S)))
print(shift_S)


n = int(input())
s = input()
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
new_s = ''
for i in range(len(s)):
	for j in range(26):
		if s[i] == alp[j]:
			if j + n >= 26:
				new_s += alp[j + n - 26]
			else:
				new_s += alp[j + n]
print(new_s)


N = int(input())
S = input()
for i in range(0, len(S)):
	print(chr((ord(S[i]) - ord('A') + N) % 26 + ord('A')), end='')


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


N = int(input())
S = input()
print(''.join(map(lambda c: chr((ord(c) - ord('A') + N) % 26 + ord('A')), S)))


N = int(input())
S = input()
ss = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = [ss[(ss.index(s) + N) % 26] for s in S]
print(''.join(ans))


n = int(input())
s = input()
ans = ''
for i in s:
	x = ord(i) + n
	if x > 90:
		x -= 26
	ans += chr(x)
print(ans)