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):
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

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

Solution (Python):
"""
author : halo2halo
date : 8, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


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

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

print(ans)

Solution (Python):
"""
author : halo2halo
date : 8, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

word = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
N = int(readline())
S = readline().decode('utf8').rstrip()

ans = [None] * len(S)
for i in range(len(S)):
    ans[i] = word[(word.index(S[i]) + N) % len(word)]

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

Solution (Python):
n = int(input())
s = input()
al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
str = ""
for i in range(len(s)):
  str += al[(al.find(s[i])+n)%26]
print(str)

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

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


output = ''

for i in range(len(S)):
    
    ind1 = alphabet.index(string[i])
    
    ind2 = (int(ind1) + N) % 26
    
    output += alphabet[ind2]

print(output)

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

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

for i in S:
    Index = upper.index(i) + N
    if Index >= 26:
        Index -= 26
        new_upper.append(upper[Index])
    else:
        new_upper.append(upper[Index])
        
print(''.join(new_upper))

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

def tran(char, num):
	after = ord(char) - 65 + num
	return(chr(after % 26 + 65))
  
after = list(map(lambda x: tran(x, num), S))
print("".join(after))

Solution (Python):
al = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
N = int(input())
S = list(input())

for i in range(len(S)):
  x = al.index(S[i])
  c = x+N
  if c <= 25:
      S[i] = al[c]
  else:
      S[i] = al[c-26]
      
print("".join(S))

Solution (Python):



n = int(input())
s = input()
result = ""

for c in s:
   o = ord(c) - 65
   d = (o + n) % 26 + 65
   dc = chr(d)
   result = result + dc

print(result)

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

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

l = []
ans = []
for i in range(len(s)):
    l.append(s[i])
    index_s = abc.index(s[i])
    index_n = (n + index_s) % 26
    ans.append(abc[index_n])
    
print(''.join(ans))

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

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

    ans = ""
    for s in S:
        index = ALPHABET.index(s) + N
        ans += ALPHABET[index % len(ALPHABET)]

    print(ans)

if __name__ == "__main__":
    main()

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

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

print(''.join(S))

Solution (Python):
import string

letters = [chr(i) for i in range(ord('A'), ord('Z')+1)]
mod = ord('Z')+1-ord('A')

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

ans = ""
for ids in s:
    idx = (ord(ids) - ord('A') + n) % mod
    ans += letters[idx]

print(ans)

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

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

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

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

Solution (Python):
n = int(input())
s = input()
x = []
import string
a = list(string.ascii_uppercase)*2

for i in s:
    b = a.index(i)
    x.append(a[b + n])
    
print(''.join(x))

Solution (Python):
n = int(input())
s = input()
x = []
import string
a = list(string.ascii_uppercase)*2

for i in s:
    
    b = a.index(i)
    j = b + n
    x.append(a[j])
    
print(''.join(x))

Solution (Python):
n = int(input())
s = input()
x = []
import string
a = list(string.ascii_uppercase)*2

for i in s:
    j = 0
    b = a.index(i)
    j = b + n
    x.append(a[j])
    
print(''.join(x))

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

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
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 list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n = I()
    s = S()
    r = []
    d = {}
    for i in range(26):
        d[string.ascii_uppercase[i]] = string.ascii_uppercase[(i+n)%26]
    for c in s:
        r.append(d[c])

    return JA(r, "")


print(main())

Solution (Python):
def main():
    alpha = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    n = int(input())
    s = input()
    output = ''
    for c in s:
        index = alpha.index(c) + n
        index = index % 26
        output += alpha[index]
    print(output)


if __name__ == "__main__":
    main()

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):
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = input()
l = [] 
for i in S:
    b = a.index(i) + N
    if b <= 25:
        w = a[b]
    else:
        w = a[b-26]
    l.append(w)
print("".join(l))

Solution (Python):
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = input()
 
for i in S:
    b = a.index(i) + N
    if b <= 25:
        print(a[b], end="")
    else:
        print(a[b-26], end="")

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

Solution (Python):
n = int(input())
s = input()
sl = list(s)
alph = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
out = ""
for i in range(len(sl)):
  id_a = alph.index(sl[i])
  id_b = (int(id_a) + n) % 26
  out += alph[id_b]
print(out)

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

A = ""
num = 0
for s in S:
    num = (ord(s) + N) if ord(s) + N < 91 else (ord(s) + N - 26)
    A += chr(num)

print(A)

Solution (Python):
input = [input() for i in range(2)]

n = int(input[0])
s = list(input[1])
answer = []
alf = [chr(ord('A') + i) for i in range(26)]


for letter in s:
  for index, al in enumerate(alf, 1):
    if(al == letter):
      if(index + n < len(alf)):
          answer.append(alf[index + n -1])
      else:
        extra = (index + n) % len(alf)
        answer.append(alf[extra -1])
		
print(''.join(answer))

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

S = [ord(s) - 65 for s in S]
for i in range(len(S)):
    position = S[i] + N
    if position > 25:
        S[i] = position - 26
    else:
        S[i] = position

print(''.join(chr(s + 65) for s in S))

Solution (Python):
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
numN = int(input())
stS = input()
result = ""
for i, c in enumerate(stS):
  result += alphabet[(alphabet.index(c) + numN) % len(alphabet)]
  
print(result)

Solution (Python):
n = int(input())
s = list(input())
for x in s:
  k = ord(x)+n
  if k >= 91:
    k -= 26 
  print(chr(k), end ="")

Solution (Python):
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

N=II()
S=input()
ABCABC = [chr(65+(i%26)) for i in range(52)]

for c in S:
    print(ABCABC[ord(c)-65+N], end='')

print('')

Solution (Python):
n = int(input())
s = input()
new_s = []
for c in s:
 a = chr((ord(c)-ord("A")+n)%26+ord("A"))
 new_s.append(a)

print("".join(new_s))

Solution (Python):
def alpha2alpha(alpha,n):
    if ord(alpha)+n-ord("A")<26:
        return chr(ord(alpha)+n)
    else:
        return chr(ord(alpha)+n-26)
N=int(input())
S=input()
T=""
for t in S:
    T=T+alpha2alpha(t,N)
print(T)

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

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

Solution (Python):
def rot_n(s, n):
  ts = ''
  alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  for i in range(len(s)):
    idx = alpha.index(s[i])
    idx += n
    if idx > 25:
      idx -= 26
    ts += alpha[idx]
  print(ts)

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

rot_n(s, n)

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

z = ord('Z')

ans = ''
for s in S:
    a = ord(s)
    b = a + N
    if b > z:
        b -= 26
    ans += chr(b)

print(ans)

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

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

for i in s:
    if ord(i)+n > 90:
        list.append(chr(ord(i)+n-26))
    else:
        list.append(chr(ord(i)+n))
        
ans = "".join(list)
print(ans)

Solution (Python):
n1 = int(input())
s2 = input()
s4 = ""

for i3 in range(len(s2)):
    s4 += (chr(((ord(s2[i3]) + n1 - 65) % 26 ) + 65))

print(s4)

Solution (Python):



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

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

string = ''.join(list)

print(string)

Solution (Python):



from string import ascii_uppercase as ALP


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


ALPALP = ALP + ALP

def f(s, N = N):
    return ALPALP[ALPALP.index(s) + N]

res = ''.join([f(s) for s in S])


print(res)

Solution (Python):

from string import ascii_uppercase as alphabet

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

res = ''
a = []

for c in alphabet:
    a.append(c)

for s in S:
    res += a[(a.index(s) + N) % len(alphabet)]

print(res)

Solution (Python):
N = int(input())
S = input()
a = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]

for s in S:
    tmp = int(a.index(s))
    tmp = tmp + N
    print(a[tmp % 26], end="")

Solution (Python):
import re
n = int(input())
s = input()
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in s:
    i = alpha.find(i)
    i += n
    if i >= 26:
        i -= 26
    ans += alpha[i]

print(ans)

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

alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

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

Solution (Python):
from string import ascii_uppercase as alph


def main():
    N = int(input())
    S = input()
    result = ''
    alphabets = []
    for a in alph:
        alphabets.append(a)
    for s in S:
        result += alphabets[(alphabets.index(s) + N) % len(alphabets)]
    print(result)


if __name__ == '__main__':
    main()

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

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

key = int(input())
text = input()
cyph = ""

for c in text:
  cyph += alph[(alph.index(c) + key) % 26]

print(cyph)

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

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in range(len(s)):
    ans+= alphabet[(alphabet.find(s[i])+n)%26]

print(ans)

Solution (Python):
def rot_encode(n):
    from string import ascii_lowercase as lc, ascii_uppercase as uc
    lookup = str.maketrans(lc + uc, lc[n:] + lc[:n] + uc[n:] + uc[:n])
    return lambda s: s.translate(lookup)

n = int(input())
s = input()
print(rot_encode(n)(s))

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

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

Solution (Python):
n = int(input())
s = list(input())
import string
ABC = list(string.ascii_uppercase)
for i in range(len(s)):
    s[i] = ABC[(ABC.index(s[i]) + n) % 26]
for i in range(len(s)):
    print(s[i], end = '')
print('\n')

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

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

newS = S.translate(str.maketrans(alphabet, alphabet[N:]+alphabet[:N]))
print(newS)

Solution (Python):
n = int(input())
s = input()
list_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']
ans = ''
for i in s:
    if list_abc.index(i) + n < 25:
        ans += list_abc[list_abc.index(i) + n]
    else:
        ans += list_abc[list_abc.index(i) + n- 26]
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"]

newS = ""
for x in S:
  newS += alphabet[(alphabet.index(x)+N)%26]
print(newS)

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
import numpy as np
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())

ans = 0
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = inp()
S = input()
ans_string = ''

for i in range(len(S)):
    ans_string += alphabet[(alphabet.index(S[i])+n)%26]
print(ans_string)

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

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)
        else:
                ans += chr(ord(S[i]) + N - 90 + 64)
print(ans)

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

alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
len_alpha = len(alpha)
len_s = len(s)
ss = []

for i in range(len_s):
    index_ss = (alpha.index(s[i])+n)%len_alpha
    ss += alpha[index_ss]
ans = "".join(ss)
print(ans)

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

R = []

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

print("".join(R))

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

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

Solution (Python):
al=[chr(i) for i in range(65, 65+26)]
n=int(input())
s=list(input())
for i in range(len(s)):
    ind=al.index(s[i])
    ind=(n+ind)%26
    s[i]=al[ind]
print(''.join(s))

Solution (Python):
num = int(input())
s = input()
res = ''

allAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for i in range(len(s)):
  res += allAlphabet[(allAlphabet.find(s[i]) + num) % 26]
  
print(res)

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

ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

string = ""
for char in S:
    string += ABC[(ABC.index(char) + N) % 26]
print(string)

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

def AtoZ(L):
  return chr(((ord(L)+N)-65) % 26 + 65)
T =""
for i in range(len(S)):
  T += AtoZ(S[i])
print (T)

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

Solution (Python):
N = int(input())
S = 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']
print("".join([alpha[(alpha.index(S[i])+N)%26] for i in range(len(S))]))

Solution (Python):
n = int(input())
ch_a, ch_z = (65, 90)

s = [ord(_)+n for _ in input()]
ss = [chr(m) if m <= ch_z else chr(m - ch_z + ch_a - 1) for m in s]
print(''.join(ss))

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

result =  ''
for i in range(len(str)):
    ordStr = ord(str[i]) + N
    if ordStr > ord("Z"):
        ordStr = ordStr - 26
    result += chr(ordStr)
    
print(result)

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

z_ascii = ord('Z')
a_ascii  = ord('A')-1
for s in range(len(S)):
    s_ascii = ord(S[s])
    s_ascii = s_ascii + N
    if s_ascii > z_ascii:
        s_ascii = s_ascii - z_ascii 
        s_ascii = a_ascii + s_ascii
    S[s] = chr(s_ascii)

print(*S,sep="")

Solution (Python):
def ints():
  return [int(x) for x in input().split()]
def readi():
  return int(input())

n = readi()
s = input()
for i in range(len(s)):
  w = ord(s[i])+n
  if w>ord('Z'):
    w = w-ord('Z')+ord('A')-1
  print(chr(w), end='')
print()

Solution (Python):
N = int(input())
S = list(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']
idx = []
for s in S:
    idx.append(alphabet.index(s) + N)

for i in range(len(idx)):
    tmp = idx[i]
    while tmp >= 26:
        tmp -= 26
    idx[i] = tmp

for i in idx:
    print(alphabet[i], end='')

Solution (Python):
n = int(input())
s = input()
t = list()
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 = 0
for i in range(len(s)):
    for j in range(26):
        if s[i] == a[j]:
            b = (j + n)
            if b >= 26:
                print(a[b - 26], end = "")
            else:
                print(a[b], end = "")
            break
print()

Solution (Python):
n = int(input())
s = list(input())
lst_26 = [(chr(ord("a") + i)).upper() for i in range(26)]

for i in range(len(s)):
    if lst_26.index(s[i])+n >= 26:
        s[i] = lst_26[lst_26.index(s[i])+n-26]
    else:
        s[i] = lst_26[lst_26.index(s[i])+n]
print("".join(s))

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

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


for i in range(len(S)):
    ss=S[i].lower()
    tmp=ord(ss) - ord("a")+N
    num=tmp%26 + ord("a")
    ss=chr(num)
    S[i]=ss.upper()

S="".join(S)
print(S)

Solution (Python):
n = int(input())
s = input()
ciphertext = ''
for i in list(s):
    if 'A' <= i <= 'Z':
            ciphertext += chr((ord(i) - ord('A') + int(n)) % 26 + ord('A'))
print(ciphertext)

Solution (Python):

n = int(input())
s = input()
ans=[]
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
a_list=[]
for j in a:
	a_list.append(j)
for i in range (len(s)):
	ans.append(a_list[a_list.index(s[i])+n].upper())
print("".join(ans))

Solution (Python):

import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(N: int, S: str):
    print(''.join([chr((ord(i)+N-ord('A'))%26 + ord('A')) for i in S]))
    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()
ans = ''
for c in s:
    ans += chr(ord(c)+n) if ord(c)+n <= 90 else chr(ord(c)+n-90+64)
print(ans)

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

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

n = ni()
s = input()
ans = ""
for i in range(len(s)):
    c = num2alpha(((alpha2num(s[i]) + n) % 26))
    if c != '@':
        ans += c
    else:
        ans += 'Z'


print(ans)

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

Solution (Python):

def convert(n):
  def _convert(c):
    ord_c = ord(c) + n
    ord_c = ord_c - 26 if ord_c > 90 else ord_c
    return chr(ord_c)
  return _convert

n = int(input())
s = input()
result = map(convert(n), list(s))
print(''.join(list(result)))

Solution (Python):
N=int(input())
S=list(input())
alpa=list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
for i in range(len(S)):
    for k in range(26):
        if S[i]==alpa[k]:
            S[i]=alpa[k+N]
            break
for n in range(len(S)):
    print(S[n],end="")

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

alphe = ['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'
         ]
beta = ['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'
         ]

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

print(''.join(S))

Solution (Python):
import string
abc=string.ascii_uppercase
abc_l=[abc[i] for i in range(26)]
n=int(input())
a=input()
a_l=[a[_] for _ in range(len(a))]
for i in range(len(a)):
	new_index=(n+abc_l.index(a_l[i]))%26
	a_l[i]=abc_l[new_index]
print(''.join(a_l))

Solution (Python):
import string
n = int(input())
s = input()
s_ = ""
az = string.ascii_uppercase
for i in s:
    s_ += az[(az.index(i) + n)%len(az)]
print(s_)

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

Solution (Python):
import string

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


ucase=string.ascii_uppercase

ucase=ucase+ucase
outstr=''
for x in S:
    p=ucase.find(x)+N
    outstr=outstr + ''.join(list(ucase)[p] )


print(outstr)

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

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

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

Solution (Python):
DICT = [chr(i) for i in range(65, 65+26)]
C = [0] * 26

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

ans = [None] * len(s)

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

print(''.join(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']
A = []
 
for c in S:
  i = L.index(c)
  A.append(L[(i + N)%26])
  
print(''.join(A))

Solution (Python):
n = int(input())
s = input()
alph = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
print(''.join(map(lambda c: alph[(alph.find(c) + n) % 26], s)))

Solution (Python):
N=int(input())
S=str(input())
M=len(S)
T=''
Al='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(M):
  for j in range(26):
    if S[i]==Al[j]:
      T +=str(Al[j+N])
      break
print(T)

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

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 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 LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    s = S()
    ans = ''
    for c in s:
        new = (ord(c) + N - ord('A')) % 26 + ord('A')
        ans += chr(new)
    print(ans)
main()

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

for i in range(len(S)):
    tmp = ord(S[i])
    tmp = tmp + N
    if tmp > 90:
        tmp = tmp-26
    U += chr(tmp)

print(U)

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

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

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

for i in range(len(S)):
  S[i] = alphabet_list[(ord(S[i]) - 64 + N) % 26 - 1]

print(''.join(S))

Solution (Python):


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

words = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"

lis = list(words)

ans = ""
for w in list(s):
    idx = lis.index(w)
    n_idx = idx + n
    ans += lis[n_idx]
print(ans)

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

ans = []

for s in S:
    work = chr(65+(ord(s)-65+N)%26)
    ans.append(work)

print(''.join(ans))

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

num2alpha = lambda c: chr(c+64)

N = int(input())
S = input()
for s in S:
    num = (alpha_dict[s] + N)
    if num > 26:
        num -= 26
    print(num2alpha(num),end="")

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

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

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

Solution (Python):
ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
N = int(input())
S = input()
ret = ""
for s in S:
  for i, alphabet in enumerate(ABC):
    if s == alphabet:
      break
  ret += ABC[(i + N) % 26]
  
print(ret)

Solution (Python):
n = int(input())
s = list(input())
a = [chr(ord("A") + i) for i in range(26)]
for i in range(len(s)):
    l = a.index(s[i])
    if l + n <= 25:
        s[i] = a[l + n]
    else:
        s[i] = a[l + n - 26]
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())
li=list(input())
for i in li:
  num=a.index(i)+N
  if num >= 26:
    num-=26
  print(a[num],end="")

Solution (Python):
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"]
print("".join([a[a.index(i)+N] if a.index(i)+N < len(a) else a[a.index(i)+N-len(a)]  for i in S]))

Solution (Python):
dic={
     "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

}

gyaku={
    1:"A",
    2:"B",
    3:"C",
    4:"D",
    5:"E",
    6:"F",
    7:"G",
    8:"H",
    9:"I",
    10:"J",
    11:"K",
    12:"L",
    13:"M",
    14:"N",
    15:"O",
    16:"P",
    17:"Q",
    18:"R",
    19:"S",
    20:"T",
    21:"U",
    22:"V",
    23:"W",
    24:"X",
    25:"Y",
    26:"Z"
}
N=int(input())
li=list(input())

for i in range(len(li)):
  a=dic[li[i]]+N
  if a>26:
    a-=26
  li[i]=gyaku[a]
for i in range(len(li)):
  print(li[i],end="")

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

Solution (Python):
import string
N = int(input())
S = list(input())
alp = list(string.ascii_uppercase)
lst = []

for i in S:
    tmp = alp.index(i)+N
    if tmp > 25:
        lst.append(tmp - 26)
    else:
        lst.append(tmp)

a = [ alp[i] for i in lst]
print(''.join(a))

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):
N=int(input())
S=input()
alp=list(S)

def func(mozi):
  ord_mozi=ord(mozi)
  new_ord_mozi=(ord_mozi-65+N)%26+65
  new_chr_mozi=chr(new_ord_mozi)
  return new_chr_mozi

new_alp=map(func,alp)
print("".join(new_alp))

Solution (Python):
N=int(input())
S=input()
Alp={"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}
new_Alp=[]

for i in range(len(S)):
  num=Alp[S[i]]
  num+=N
  num%=26
  
  for key,atai in Alp.items():
    if atai==num:
      new_Alp.append(key)

new_alp="".join(new_Alp)
print(new_alp)

Solution (Python):
alpa = [chr(ord('a') + i) for i in range(26)]

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

ans = ''

for i in s:
    ans += alpa[(alpa.index(str.lower(i))+n) % 26]
    
print(str.upper(ans))

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

ans = ""
for i in range(len(s)):
  num = ord(s[i])
  num = num + (KEY % 26)
  if ord("Z") < num:
    num = ord("A") + num - ord("Z") - 1
  ans += chr(num)
print(ans)

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

alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in S:

    s=ord(i)
    s=(s-65+N)%26+65
    i=chr(s)
    letters+=i
print(letters)

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

for i in range(len(s)):

    ss += str(alp[alp.index(s[i])+n])

print(ss)

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

a_z_list = [""] * 26
for i in range(65,65+26):
    a_z_list[i - 65] = chr(i)

a_z_list *= 2

ans = []

for i in s:
    ans.append(a_z_list[ord(str(i)) -65 + N ])

print("".join(ans))