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(raw_input())
s = raw_input()

def caesar_encrypt(realText, step):
    outText = ""
    cryptText = []

    uppercase = ['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 eachLetter in realText:
        index = uppercase.index(eachLetter)
        crypting = (index + step) % 26
        cryptText.append(crypting)
        newLetter = uppercase[crypting]
        outText+=newLetter
    return outText
  
print(caesar_encrypt(s,n))

Solution (Python):
import string
slice_num = int(input())
string_dic = list(input())

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




for i in range(len(string_dic)):
    string_dic[i] = omoji[(omoji.index(string_dic[i])+slice_num)%26]


for i in range(len(string_dic)):
    print(string_dic[i],end="")

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

Solution (Python):
def f(c, n):
  code = ord(c)
  code += n
  if code > ord('Z'):
    code -= 26
  return chr(code)

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

s2 = ''.join(list(map(lambda c: f(c,n), list(s))))

print(s2)

Solution (Python):
import sys
sys.setrecursionlimit(int(1e6))

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

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

print(ans)

Solution (Python):


n = int(input())
S = input()

moji_dict = {'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}
num_dict = {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'}
for s in S:
    
    
    res = moji_dict[s] + n
    if res > 26:
        print(num_dict[res - 26],end="")
    else:
        print(num_dict[res],end="")

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

Solution (Python):
N = int(input())
S = input()
original_index = [ord(c) for c in S]
def trans(index, N):
    if index + N < (65 + 26):
        return chr(index + N)
    else:
        return chr(index + N - 26)

transformed = [trans(ind, N) for ind in original_index]
print("".join(transformed))

Solution (Python):

N = int(input())
S = input()
enc = ""

def rot_n(c, n):
    if 'a' <= c and c <= 'z':
        return chr((ord(c) - ord('a') + int(n)) % 26 + ord('a'))
    
    if 'A' <= c and c <= 'Z':
        return chr((ord(c) - ord('A') + int(n)) % 26 + ord('A'))
    
    return c

def rot(s, n):
    c = (rot_n(c, n) for c in s)
    return ''.join(c)

print(rot(S, N))

Solution (Python):
import string

def shift_enc(message, n, cap=True):
    output_index = 0
    output = ""
    for chara in message:
        output_index = (string.ascii_uppercase.index(chara.upper()) + int(n)) % 26
        output += string.ascii_uppercase[output_index]
    if cap == False:
        output = output.lower()
    return output

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

print(shift_enc(S, N, True))

Solution (Python):
n = int(input())
x = str(input())
outp = []

word = {
        "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
        }

for w in x:
    new = (word[w] + n) % 26
    for key, value in word.items():
        if new == value:
            outp.append(key)

print("".join(outp))

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

for i in range(len(chars)):
  num = alp.index(chars[i])
  if n+num>=26:
      num -= 26
  nalp.append(alp[n+num])

mojiretu = ''
 
for x in nalp:
    mojiretu += x
print(mojiretu)

Solution (Python):
N = int(input())
S = list(input())
pos_A = ord('A')

res = list(map(lambda x: chr(pos_A + (ord(x) - pos_A + N) % 26), S))

print(''.join(res))

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

result = []

for s in S:
    result.append(chr(ord(s)+N))

for r in result:
    if ord(r) >= 91:
        print(chr(ord(r)-26), end="")
    else:
        print(r, end="")

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

ans = ''
for c in s:
    tmp_i = ord(c) - ord('A')
    if tmp_i + n < 26:
        ans+=chr(ord(c)+n)
    else:
        ans+=chr(ord('A')+(n-(ord('Z')-ord(c)))-1)
    
print(ans)

Solution (Python):
a=int(input())
b=input()

enc = ""

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

print(enc)

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

for l in s:
    tmp = ord(l)
    tmp += n
    
    if not (65 <= tmp <= 90):
        tmp -= 26

    
    print(chr(tmp), end="")
print("")

Solution (Python):
n = int(input())
s = input()
arr = {'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}
arr2 = {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', 0:'Z'}
ans = ''
for i in s:
    ans += arr2[(arr[i] + n) % 26]
print(ans)

Solution (Python):
N=int(input())
S=input()
s_lst=[]
s_dic={0:'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'}

for s in S:
    for k,d in s_dic.items():
        if s==d and k+N<=25:
            buf=s_dic[k+N]
            s_lst.append(buf)
            break
        elif s==d and k+N>25:
            buf=s_dic[k+N-26]
            s_lst.append(buf)
            break
v=''
for s in s_lst:
    v+=s
print(v)

Solution (Python):
N=int(input())
S=list(input())
A=''
for i in S:
    if ord(i)+N<=ord('Z'):
        A+=chr(ord(i)+N)
    else:
        A+=chr(ord(i)+N-(ord('Z')-ord('A')+1))
print(A)

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

    ns = []
    for ch in s:
        ns.append(chr((ord(ch) - ord('A') + n) % 26 + ord('A')))
        

    print("".join(ns))

if __name__ == "__main__":
    main()

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

Solution (Python):
def main():
    n=int(input())
    s=input()
    ans=[]
    
    
    
    for i in range(0,len(s)):
        if ord(s[i])+n <= 90:
            tmp=int(ord(s[i]) + n)
            ans.append(chr(tmp))
        else:
            tmp=int(90-ord(s[i])-n)
            tmp2=-1*tmp+64
            ans.append(chr(tmp2))
    for i in range(0,len(ans)):
        print(ans[i],end='')
    print('\n')

if __name__=='__main__':
    main()

Solution (Python):
shiftCount = int(input())
s = input()
s = s[:]
answer = ""

for i in s :
    AsciiCode = ord(i) + shiftCount
    if AsciiCode > 90 :
        AsciiCode -= 26
    answer += chr(AsciiCode)

print(answer)

Solution (Python):
N = int(input())
S = [str(x) for x in input()]
alpha_list = [chr(ord('A') + i) for i in range(26)] * 2
for i in range(len(S)):
    S[i] = alpha_list[alpha_list.index(S[i]) + N]
ans = ''.join(S)
print(ans)

Solution (Python):


import sys
import math

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        
        
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    n = int(lines[0])
    s = lines[1]

    return (n, s)


def solve(n, s):

    ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    
    m = dict([(e, i) for i, e in enumerate(ch)])

    result = []
    for c in s:
        k = m[c] + n
        r = k % 26
        result.append(ch[r])

    return  "".join(result)


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

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

for letter in S:
    result += chr((ord(letter) - 65 + N) % 26 + 65)

print(result)

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

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

C = ""

for i in range(len(S)):
  num = ord(S[i]) + N
  if num >= 91:
    num = num - 26
  C += chr(num)
  
print(C)

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


word_list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZA'

new_list = ''
for i in S:
	fd = word_list.find(i)
	new_list += word_list[fd + N]
	
print(new_list)

Solution (Python):

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

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

ans = []
for ss in s:
    ind = l.index(ss) + 1
    n_ind = ind + n
    r = n_ind % 26 - 1
    ans.append(l[r])

print("".join(map(str,ans)))

Solution (Python):
n = int(input())
s = input()
a = len(s)
ans = []

for i in range(a):
    j = ord(s[i])
    j += n
    if j>90:
        j -= 26
    s = s[:i] + chr(j) + s[i+1:]
print(s)

Solution (Python):
import re

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

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

Solution (Python):
import sys
n = int(input())
a = input()

for s in a:
  o = ord(s)+n
  if o > 90:
    o = o-26
  print(chr(o), end="")

Solution (Python):
num2alpha = lambda c: chr(c+65)
alpha2num = lambda c: ord(c) - ord('A')
N = int(input())
S = input()
new_S = str()
for i in range(len(S)):
    new_S = new_S + num2alpha((int(alpha2num(S[i]))+N)%26)
print(new_S)

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

def solve(s,K):
    alpha2num = lambda s: ord(s) - ord('A') + 1
    num2alpha = lambda num: chr(num+64)
    num  = alpha2num(s)
    try_num = (num+K)%26
    if try_num == 0:
        try_num = 26
    alpha = num2alpha(try_num)
    return alpha
output = []
for i in range(len(S)):
    output.append(solve(S[i],N))
print(''.join(output))

Solution (Python):
n=int(input())
a=input()
a=a.lower()
enc=""
for i in list(a):
    ASCII=ord(i)
    num=ASCII-97
    num=(num+n)%26
    ASCII=num+97
    enc+=chr(ASCII)
print(enc.upper())

Solution (Python):
N = int(input())
S = input()
alphabet = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
alphabet_dicts = {}
for i, al in enumerate(alphabet):
    alphabet_dicts[al] = i
S_dush = alphabet[N:]+alphabet[:N]
ans = ""
for s in S:
    ans += S_dush[alphabet_dicts[s]]
print(ans)
print()

Solution (Python):
n = int(input())
s = input()
x = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
    if x.index(s[i]) + n > 25:
        print(x[x.index(s[i]) + n - 26], end='')
    else:
        print(x[x.index(s[i]) + n], end='')

Solution (Python):

N = int(input())
words = list(input())

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

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

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

main()

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

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

alfa = alfaA + alfaB

ans = []

for i in s:
    ans.append(alfa[alfa.index(i) + n])

print(''.join(ans))

Solution (Python):
n = int(input())
s = input()
result = ""
for i in s:
   tmp = ord(i) + n
   
   if tmp > 90:
      tmp -= 26

   result += chr(tmp)


print(result)

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

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

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

L=[]
for i in range(len(s)):
    L.append((alpha2num(s[i])+n)%26)


for i in range(len(L)):
    if L[i]==0:
        L[i]=26
    L[i]=num2alpha(L[i])

print(''.join(L))

Solution (Python):
N=int(input())
S=input()
st=""
n2=0
for i in range(len(S)):
  c1=S[i]
  n1=ord(c1)
  if n1+N>26:
    n2=(((n1-65)+N)%26)+65
  else:
    n2=n1
  st=st+chr(n2)
print(st)

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

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

for char in list(S):
    ASCII = ((ord(char) - ord("A") + N) % 26) + ord("A")
    enc += chr(ASCII)
    
print(enc)

Solution (Python):

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

res=[]
for t in s:
	res.append(chr((ord(t)-ord("A")+n)%26+ord("A")))
print("".join(res))

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

ord_max = ord('Z')
for t in S:
    ord_t = ord(t)
    ord_t += N
    if ord_t > ord_max:
        ord_t -= 26
    print(chr(ord_t), end='')
print('\n')

Solution (Python):

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

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

def alpha(a):
  if a == "A":
    a = 1
  elif a == "B":
    a = 2
  elif a == "C":
    a = 3
  elif a == "D":
    a = 4
  elif a == "E":
    a = 5
  elif a == "F":
    a = 6
  elif a == "G":
    a = 7
  elif a == "H":
    a = 8
  elif a == "I":
    a = 9
  elif a == "J":
    a = 10
  elif a == "K":
    a = 11
  elif a == "L":
    a = 12
  elif a == "M":
    a = 13
  elif a == "N":
    a = 14
  elif a == "O":
    a = 15
  elif a == "P":
    a = 16
  elif a == "Q":
    a = 17
  elif a == "R":
    a = 18
  elif a == "S":
    a = 19
  elif a == "T":
    a = 20
  elif a == "U":
    a = 21
  elif a == "V":
    a = 22
  elif a == "W":
    a = 23
  elif a == "X":
    a = 24
  elif a == "Y":
    a = 25
  else:
    a = 26
  return a

def num(a):
  if a == 0:
    a = "A"
  elif a ==1:
    a ="B"
  elif a ==2:
    a ="C"
  elif a ==3:
    a ="D"
  elif a ==4:
    a ="E"
  elif a ==5:
    a ="F"
  elif a ==6:
    a ="G"
  elif a ==7:
    a ="H"
  elif a ==8:
    a ="I"
  elif a ==9:
    a ="J"
  elif a ==10:
    a ="K"
  elif a ==11:
    a ="L"
  elif a ==12:
    a ="M"
  elif a ==13:
    a ="N"
  elif a ==14:
    a ="O"
  elif a ==15:
    a ="P"
  elif a ==16:
    a ="Q"
  elif a ==17:
    a ="R"
  elif a ==18:
    a ="S"
  elif a ==19:
    a ="T"
  elif a ==20:
    a ="U"
  elif a ==21:
    a ="V"
  elif a ==22:
    a ="W"
  elif a ==23:
    a ="X"
  elif a ==24:
    a ="Y"
  else:
    a = "Z"
  return a

ll = [0] * len(S)
for i in range(len(S)):
  b = 0
  b = alpha(S[i]) - 1
  b = (b + N) % 26
  c = num(b)
  ll[i] = c
  
print("".join(ll))

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

def _next(c, N):
    b = int.from_bytes(c.encode("utf-8"), "little") - 65
    return (b + N) % 26

def _decode(b):
    return (b + 65).to_bytes(1, "little")
    
ls = [_decode(_next(s, N)).decode("utf-8") for s in S]

print("".join(ls))

Solution (Python):
n = int(input())
s = input()
t = ''
abc = [chr(i) for i in range(65, 65+26)]
for i in s:
  m = abc.index(i)
  if m+n <= 25:
    t += abc[m+n]
  else:
    t += abc[m+n-26]
print(t)

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

n = int(input())
S = list(input())

for i in range(len(S)):
    a = alpha2num(S[i])
    a += n
    a %= 26
    if (a==0):
        a=26
    S[i] = num2alpha(a)

print(''.join(S))

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

PLAIN = input()
PLAIN = PLAIN.lower()

KEY = N


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):
al=["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 s in S:
    i=al.index(s)
    
    print(al[(i+n)%26],end="")

Solution (Python):
n=int(input())
s=input()
a="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
def func(x):
  c=a.find(x)
  return a[(c+n)%26]
t=""
for i in range(len(s)):
  t+=func(s[i])
print(t)

Solution (Python):
N = int(input())
S = input()
ans =[]
for s in S:
    c = ord(s)+N
    if c > 90:
        c -= 26
    ans.append(chr(c))
print(''.join(ans))

Solution (Python):

N = int(input())
S = input()
li = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"*10
dic = {}
for i in range(26):
    dic[li[i]] = i
re = []
for i in range(len(S)):
    re.append(li[dic[S[i]]+N])
print("".join(re))

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

t=""
for c in s:
  t += chr(ord('A')+(ord(c)-ord('A')+n)%26)

print(t)

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

result = []
for s in S:
    result.append(chr((ord(s) -65 + N) % 26 + 65))

for s in result:
    print(s, end="")

Solution (Python):
n = int(input())
s = input()
n = n % (ord('Z') - ord('A') + 1)
ans = ''
for i in s:
    if ord(i) + n > ord('Z'):
        ans += chr(ord(i) + n - (ord('Z') - ord('A') + 1))
    else:
        ans += chr(ord(i) + n)
print(ans)

Solution (Python):
N = int(input())
S = input()
new_S = ""
for alphabet in S:
    if ord(alphabet) + N > ord("Z"):
        new_S = new_S + chr(ord("A")-1+(ord(alphabet) + N - ord("Z")))
    else:
        new_S = new_S + chr(ord(alphabet) + N)
print(new_S)

Solution (Python):
a = int(input())
b = 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')))
        else:
            ns.append(ch)
    return "".join(ns)

result = caesar(b,-a)
print(result)

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

a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
a = list(a)
answer = []
for i in range(len(S)):
  num = a.index(S[i])
  num_next = (num+N)%26
  answer.append(a[num_next])
answer = ''.join(answer)
print(str(answer))

Solution (Python):
N=int(input())
S=input()
T=""
if S.isalpha() and S.isupper() and 1 <= len(S) <= 100000 and 0 <= N <= 26:
    for i in range(len(S)):
       T += chr(( ord(S[i]) - ord("A") + N ) % 26 + ord("A"))
    print(T)

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

answer=[]
sumple=["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)):
    answer.append(sumple[(sumple.index(S[i])+N+1)%26-1])
print(''.join(map(str,answer)))

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

Solution (Python):
uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def anagram(l,n):
    newletter = uppercase[(uppercase.find(l) + n) % 26]
    return newletter

n = int(input())
string = input()
new_string = ''
for l in string:
    new_string += anagram(l, n)
    
print(new_string)

Solution (Python):
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

n = int(input())
s  = [alpha.index(i) for i in input()]

s = map(lambda x: (x+n)% 26, s)

ans = ""
for i in s:
    ans = ans + alpha[i]
    
print(ans)

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

num2alpha = lambda c: chr(c+64) if c <= 26 else chr(c+38)
alpha2num = lambda c: ord(c) - ord('A') + 1

SNUM = map(alpha2num, S)
print(''.join(list(map(lambda a: num2alpha(a + N), SNUM))))

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

tmplist = ['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']
result = ''

for i in range(len(s)):
    tmp = tmplist.index(s[i])
    if tmp + n < 26:
        result += tmplist[tmp + n]
    else:
        result += tmplist[tmp + n - 26]

print(result)

Solution (Python):
def next_ord(s, N):
    candidate_ord = ord(s) + N
    if candidate_ord > ord('Z'):
        candidate_ord -= 26
    return candidate_ord


N = int(input())
alphabets = input()
print("".join([chr(next_ord(a, N)) for a in alphabets]))

Solution (Python):

import string
import sys
from itertools import chain, dropwhile, takewhile

INF = float("inf")


def read(
    *shape, f=int, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)
):
    def read_word():
        w = lambda c: c in whitespaces
        nw = lambda c: c not in whitespaces
        return f("".join(takewhile(nw, dropwhile(w, it))))

    if not shape:
        return read_word()
    elif len(shape) == 1:
        return [read_word() for _ in range(shape[0])]
    elif len(shape) == 2:
        return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]


def readi(*shape):
    return read(*shape)


def readi1(*shape):
    return [i - 1 for i in readi(*shape)]


def readf(*shape):
    return read(*shape, f=float)


def reads(*shape):
    return read(*shape, f=str)


def arr(*shape, fill_value=0):
    if len(shape) == 1:
        return [fill_value] * shape[0]
    elif len(shape) == 2:
        return [[fill_value] * shape[1] for _ in range(shape[0])]


def dbg(**kwargs):
    print(
        ", ".join("{} = {}".format(k, repr(v)) for k, v in kwargs.items()),
        file=sys.stderr,
    )


def main():
    N = readi()
    S = reads()
    print("".join(chr((ord(c) + N + 13) % 26 + 65) for c in S))


if __name__ == "__main__":
    main()

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

Solution (Python):
n = int(input())
s = input()
cnt = []
c_new = 'a'

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

print(''.join(cnt))

Solution (Python):
def myinput():
    n = int(input())
    s = input()
    return n, s

def rot(n, s):
    z = ord('Z')
    chars = []

    for c in s:
        code = ord(c) + n
        if code > z:
            code -= 26
        chars.append(chr(code))
    return ''.join(chars)

def main():
    n, s = myinput()
    ret = rot(n, s)
    print(ret)

main()

Solution (Python):
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from itertools import permutations, combinations,combinations_with_replacement,product
from fractions import Fraction as frac
import bisect
import heapq

import logging
logging.basicConfig(level=logging.DEBUG)

import sys


setrecursionlimit(1000000)

MOD = 10**9+7
INF = float('inf')

def main():
    N=int(input())
    S=input()
    A='ABCDEFGHIJKLMNOPQRSTUVWXYZ'

    ans=[]
    for c in S:
        i=A.index(c)
        ans.append(A[(i+N)%26])
    print("".join(ans))
main()

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

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

ans=""

for a in s:
  index = l.index(a)
  index=(index+n)%26
  ans += l[index]

print(ans)

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

for i in range(len(S)):
    index = alphabets.index(S[i])
    moved = index+N
    if 25 < moved:
        moved = moved-26
    S[i] = alphabets[moved]
print(*S,sep="")

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

Solution (Python):
N = int(input())
S = input()
import string
alist = list(string.ascii_uppercase)
adict = {"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}
ans = []
for s in S:
  i = adict[s]
  r = ""
  if i + N > 25:
    r = alist[i + N - 26]
  else:
    r = alist[i + N]
  ans.append(r)
print("".join(ans))

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

Solution (Python):

import sys


def solve(N: int, S: str):
    for i in range(len(S)):
        print( chr( (ord(S[i]) + N - ord('A')) % 26 + ord('A') ), end="")
    print()
    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 = list(input())
order = tuple(list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'))
for i in range(len(S)):
    S[i] = order[(order.index(S[i])+N)%26]
print(''.join(S))

Solution (Python):



alpha = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
n = int(input())
s = list(input())

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

print(''.join(res))

Solution (Python):
def num():
    return int(input())

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


"""
date = {"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}
print(date[input()])
"""

import string as s
N,S = num(),input()
letters = s.ascii_uppercase
ans = ""
for i in S:
    ans += letters[(letters.index(i)+N)%len(letters)]
print(ans)

Solution (Python):
N=int(input())
S=list(input())
def caeser(S,n):
  r = []
  for s in S:
    if ('A' <= s and s <= 'Z'):
      r.append(chr((ord(s) - ord('A') + n) % 26 + ord('A')))
    
    elif ('a' <= s and s <= 'z'):
      r.append(chr((ord(s) - ord('a') + n) % 26 + ord('a')))
  return "".join(r)
  
print(caeser(S,N))

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

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

S2=[]

for i in S:
    i=upper[(upper.index(i)+N)%26]
    S2.append(i)

print(''.join(S2))

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

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

print(*S,sep="")

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

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


for i in range(len(S)):
	out += chr(S[i])

print(''.join(out))

Solution (Python):
n = int(input())
s = input()
nums = []
for string in s:
    cache = ord(string) + n
    if cache > 90:
        cache -= 26
    nums.append(chr(cache))
print(*nums, sep="")

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

for i in range(len(s)):
    if ord(s[i])+n<=90:
        s[i]=chr(ord(s[i])+n)
    else:
        s[i]=chr(64+ord(s[i])+n-90)

print(*s,sep='')

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

s = input()
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans=""
for i in range(len(s)):
    idx=0
    idx = alp.find(s[i])
    idx = (idx + n)%26
    ans = ans+alp[idx]
print(ans)

Solution (Python):
n = int(input())
s = input()
ans = ""
for c in s:
	o = ord(c)
	o = chr(o+n)
	if o<='Z':
		ans = ans + o
	else:
		o = ord(o)-91
		
		o = 65+o
		ans = ans + chr(o)

print(ans)

Solution (Python):
shift_num=input()
input_line=input()

character_dict={'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}
new_line=''
for item in input_line:
  char_index=int(character_dict[item])+int(shift_num)
  if char_index>26:
    for key, value in character_dict.items():
      if value == (char_index-26):
        new_line=new_line+str(key)
  else:
    for key, value in character_dict.items():
      if value == (char_index):
        new_line=new_line+str(key)
print (new_line)

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

a_ascii = ord("A")
z_ascii = ord("Z")
ans = ""

for c in S:
    new_ascii = ord(c) + N
    if new_ascii > z_ascii:
        new_ascii = new_ascii - 26
    ans += chr(new_ascii)

print(ans)

Solution (Python):
def solve():
    n = int(input())
    A = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    R = A[n:] + A[:n]
    M = {A[i]: R[i] for i in range(26)}
    ans = ""
    for s in input():
        ans += M[s]
    print(ans)
solve()

Solution (Python):
import string
n=int(input())
s=input()
lst=[]
for i in s:
    ind=string.ascii_uppercase.index(i)+n
    while(ind >25):
        ind=(string.ascii_uppercase.index(i)+n) -26
    lst.append(string.ascii_uppercase[ind])

print(''.join(lst))

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

length_S = len(S)

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

X = ''

for i in range(length_S):
    s = S[i]
    index_alpha = alpha.index(s)

    if index_alpha + N >= 26:
        num = index_alpha + N - 26
        new_s = alpha[num]
    else:
        num = index_alpha + N
        new_s = alpha[num]

    X = X + new_s

print(X)

Solution (Python):
import string
N = int(input())
S = str(input())
arr = [chr(i) for i in range(65, 65+26)]*2
arr = "".join(arr)
new_arr = ""
for s in S:
  idx = arr.find(s)
  s = arr[idx+N]
  new_arr += s
print(new_arr)

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


PLAIN = s

KEY = n

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()
m = list(s)
p=[]
for i in m:
  p.append(chr(65 + (ord(i)-65+n)%26))
for t in p:
  print(t,end="")