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



Sample input:
2
ABCXYZ


Sample output:
CDEZAB

Submission status: Accepted

Solution code:
alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
N = int(input())
S = input()
result=[]
for i in list(S):
    result.append(alphabet[alphabet.index(i)+N])
mojiretsu = ''.join(result)
print(mojiretsu)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
x = len(s)
ans = []
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"]
for i in range(x):
  ans.append(abc[(abc.index(s[i])+n) % 26])
print("".join(ans))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = ""
for s in S:
  if ord(s) + N <= ord("Z"):
    ans += chr(ord(s) + N)
  else:
    ans += chr(ord(s) + N - 26)
print(ans)

Submission status: Accepted

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

#print(s)
#65~90

for i in range(len(s)):
    a = ord(s[i])+n
    #print("a is:" + str(a))
    if a > 90:
        s[i]=chr(a-26)
    else:
        s[i]=chr(a)
print("".join(s))

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
character = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(s)):
  for j in range(len(character)):
    if s[i]==character[j]:
      num = (j+n)%len(character)
      s[i] = character[num]
      break
print("".join(s))

Submission status: Accepted

Solution code:
# coding: utf-8

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

ans = [None] * len(S)

# Z = 90
for i, s in enumerate(S):
    n = ord(s)
    ans[i] = chr(n + N) if n+N <= 90 else chr(64 + (n+N-90))

print("".join(ans))

Submission status: Accepted

Solution code:
#import sys
MOD = 10 ** 9 + 7
#input = sys.stdin.readline
import math

#import bisect

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def main():
#    h,w,a,b = map(int, input().split())
    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"]
#    a = [[0] * i for i in range(h)]
    b=[]
    for i in range(len(s)):
        temp=a.index(s[i])
        temp+=n
        if temp>=26:
            temp-=26
        s[i]=a[temp]


    c="".join(s)
    print(c)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ls = list(map(str,input()))
book =["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 ls:
    ans.append(book[(book.index(a)+n)%26])
print("".join(ans))

Submission status: Accepted

Solution code:
import heapq as h
import math
import numpy as np
import copy
import itertools

 
# x,y = map(int,input().split())
n = int(input())
s = input()
# a = list(map(int,input().split()))
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']
def change(a,n):
    ix = alphabet.index(a)
    ix += n
    return alphabet[ix%26]
new = ''
for tmp in s:
    new += change(tmp,n)
print(new)

Submission status: Accepted

Solution code:
rot = int(input())
s = input()
c = list(s)
r = [chr((ord(i)-ord('A')+rot)%26+ord('A')) for i in c]
print(''.join(r))

Submission status: Accepted

Solution code:
N = int(raw_input())
S = raw_input()

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

abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

ans = ""
for char in S:
    num = alphabet[char]
    ans = ans + abc[(num+N)%26-1]

print ans

Submission status: Accepted

Solution code:
n = int(input())
s = input()
l = []
m = 0
#print(s)
for i in range(len(s)):
    m = (ord(s[i])+n)
    if m>90:
        m = m-26
    print(chr(m),end='')

Submission status: Accepted

Solution code:

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

N = inp()




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

print(''.join(S))

Submission status: Accepted

Solution code:
N=input()
S=raw_input()
str="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

ans=""
for x in S:
    idx=str.index(x)
    idx+=N
    idx%=26
    ans+=str[idx]
print ans

Submission status: Accepted

Solution code:
n = int(input())
s = input().strip()

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
s = list(S)
for i in range(len(s)):
	a = ord(s[i])+N
	while a > 90:
		a = a - 26
	s[i] = chr(a)
S = ''.join(s)
print(S)

Submission status: Accepted

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

ans = []
base = ord("A")
for c in S:
    ans.append(chr(((ord(c) + N - base) % 26)+base))

print("".join(ans))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
S = str(input())

alpha_list = [chr(i) for i in range(65, 65+26)]
ans = ""
for s in S:
    ans += alpha_list[(alpha_list.index(s) + N) % 26]
print(ans)

Submission status: Accepted

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

for i in s:
    num = ord(i) + n
    while num > 90:
        num -= 26
    ans += chr(num)
print(ans)

Submission status: Accepted

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

text = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
res = ''

for i in s:
    j = text.index(i)
    k = (j + n) % 26
    res += text[k]

print(res)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
ans_S = []

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

for i in range(len(S)):
  if l.index(S[i]) + N <= 25:
    ans_S.append(l[l.index(S[i]) + N])
  else:
    ans_S.append(l[l.index(S[i]) + N - 26])
    
print(str(''.join(ans_S)))

Submission status: Accepted

Solution code:
n = int(input())
S = list(input())
temp=['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] = temp[((temp.index(S[i]))+n)%26]
print(*S,sep='')

Submission status: Accepted

Solution code:
#B
n = int(input())
s = list(input())
for i in s:
    i_num = ((ord(i) - 65 + n) % 26) + 65
    print(chr(i_num), end="")

Submission status: Accepted

Solution code:
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"]

new_s = []
for i in range(len(s)):
    i_num = alphabet.index(s[i])
    if i_num + 1 + n <= 26:
        new_num = i_num + n
    else:
        new_num = n + i_num  - 26
    new_s.append(alphabet[new_num])

print("".join(new_s))

Submission status: Accepted

Solution code:
alpha = [i for i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']
n = int(input())
s = input()

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

print(''.join(l))

Submission status: Accepted

Solution code:
import sys
import math
input = sys.stdin.readline


def main():
    sc = Scan()
    n = sc.intarr()[0]
    s = sc.strarr()[0]

    new_str = ''
    for i in s:
        i = ord(i)
        i = i + n
        if i > 90:
            i -= 26
        i = chr(i)
        new_str += i

    print(new_str)


class Scan():

    def intarr(self):
        line = input()
        array = line.split(' ')
        num_array = [int(n) for n in array]
        return num_array

    def intarr_ver(self, n):
        return [int(input()) for _ in range(n)]

    def strarr(self):
        line = input()
        array = line.split(' ')
        array[-1] = array[-1].strip('\n')
        return array


main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
t = []
for c in s:
    k = (a.index(c) + n) % 26
    t.append(a[k])

print(''.join(t))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

convert_list = {}
for i in range(26):
    charactor = (i + N) % 26
    convert_list[chr(i+65)] = chr(charactor+65)

new_S = ''
for i in range(len(S)):
    new_S += convert_list[S[i]]

print(new_S)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
L = len(S)
T = ''
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

for i in range(L):
  for j in range(26):
    if S[i] == alpha[j]:
      T = T + alpha[j + N]
      break

print(T)

Submission status: Accepted

Solution code:
import collections
import itertools as it
import math
import numpy as np

# A = input()
# A = int(input())
# A = map(int, input().split())
# A = list(map(int, input().split()))
# A = [int(input()) for i in range(N)]
#
# c = collections.Counter()

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



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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = ""

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

print(ans)

Submission status: Accepted

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


def index(s, N):
    ABC = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 
    s_ind = ABC.find(s)
    an_ind = (s_ind + N) % 26
    return(ABC[an_ind])

rotn = ''
for s in S:
    rotn += index(s, N)
print(rotn)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
S = [i for i in S]
list1 = ['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']


newlist = []
for i in range(len(S)):
    ind1 = list1.index(S[i])
    newlist.append(list1[ind1+N])

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

Submission status: Accepted

Solution code:
alpha=lambda x:chr(x+64)
num=lambda x:ord(x)-ord("A")+1

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

for i in range(len(s)):
    now=num(s[i])
    num_now=(now+n)%26
    if num_now==0:
        num_now=26
    ans+=alpha(num_now)
print(ans)

Submission status: Accepted

Solution code:
import string

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

S =[]
al = []
new = []

for l in s:
    S.append(l)

for x in string.ascii_uppercase:
    al.append(x)

for i in range(len(s)):
    ind = al.index(S[i])
    new_ind = (ind + n) % 26
    new_s = al[new_ind]
    new.append(new_s)

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

Submission status: Accepted

Solution code:
N=int(input())
S=input()
length=len(S)

alp='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
num=[i for i in range(26)]

def f(s, n, alp, add):
  out=[0 for i in range(n)]
  for i in range(n):
    for j in range(26):
      if s[i]==alp[j]:
        out[i]=j
        
  out2=[out[i]+add for i in range(n)]
  out3=[out2[i]%26 for i in range(n)]
  out4=[alp[out3[i]] for i in range(n)]
  return out4

ans=f(S, length, alp, N)

print("".join(ans))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
b = ""
for i in s:
    j = (alpha.index(i) + n) % 26
    b += alpha[j]
print(b)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ans = ''
c = ['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)):
    char = s[i]
    idx = c.index(char)
    new_idx = (idx + n) % 26
    ans += c[new_idx]
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
t=input()
s=""
for i in range(0,len(t)):
    if(ord(t[i])+n<=90):
        s=s+chr(ord(t[i])+n)
    else:
        d=(ord(t[i])+n)%91+65
        s=s+chr(d)
print(s)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ''
for i in range(len(s)):
    ans += char[(ord(s[i])-65+n) % 26]
print(ans)

Submission status: Accepted

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

alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in range(len(S)):
    ind = alph.index(S[i]) + N
    if ind >= len(alph):
        ans += alph[ind-len(alph)]
    else:
        ans += alph[ind]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
az = [chr(ord('A') + i) for i in range(26)]
ans = []
for x in S:
    i = (az.index(x) + N) % len(az)
    ans.append(az[i])
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

result = ""

for s in S:
    c = ord(s)
    k = c + N
    if 65 <= k <= 90:
        result += chr(k)
    else:
        result += chr(k - 26)

print(result)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = input()
    s = []

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

    print(*s, sep='')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"*2
answer = ""
for i in range(len(s)):
    index = alphabet.index(s[i])
    index += n
    answer += alphabet[index]
print(answer)

Submission status: Accepted

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

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

for let in s:
    originalIndex = alpha.index(let)
    if originalIndex+n > len(alpha) - 1:
        answer.append(alpha[originalIndex+n-len(alpha)])
    else:
        answer.append(alpha[originalIndex+n])

print("".join(answer))

Submission status: Accepted

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

ABC=[chr(i) for i in range(65, 65+26)]+[chr(i) for i in range(65, 65+26)]
M=N%26

for s in S:
  print(ABC[ABC.index(s)+M], end="")

Submission status: Accepted

Solution code:
#coding:utf-8
from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]


    n = II()
    s = input()
    a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    b = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
    ans = ""
    for i in range(len(s)):
        ans = ans + (b[a.find(s[i]) + n])
    print(ans)





if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
num = 26-n
for w in s:
    print(a[a.find(w)-num], sep='', end='')

Submission status: Accepted

Solution code:
N=int(input())
S=input()
OUT=""
for i in S:
  OUT += chr((ord(i) - ord("A") + N) % 26 + ord("A")  )

print(OUT)

Submission status: Accepted

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

def decode(string):
    res = []
    for s in string:
        res.append(chr((ord(s) - ord('A') + n) % 26 + ord('A')))
    return ''.join(res)

print(decode(s))

Submission status: Accepted

Solution code:
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
d = {'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}
n = int(input())
s = input()

for i in range(len(s)):
  print(a[d[s[i]] + n], end='')

Submission status: Accepted

Solution code:
def main():
    alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    n = int(input())
    s_list = list(input())

    s_list_n = [0] * len(s_list)
    ans_list = [0] * len(s_list)
    for i, s in enumerate(s_list):
        temp = (alphabet.find(s) + n) % len(alphabet)
        ans_list[i] = alphabet[temp]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
S = input()
a = []
for i in S:
    b = ord(i)+N
    if b > 90:
        b = b-26
    a.append(chr(b))

print(''.join(a))

Submission status: Accepted

Solution code:
from string import ascii_uppercase as alpha
n=int(input())
s=list(input())
z=''
alphab=(alpha*2)[n:26+n]
for i in s:
    z+=alphab[alpha.index(i)]
print(z)

Submission status: Accepted

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

S_ = []
for i in range(len(S)):
    new = ord(S[i]) + N
    if ord("A") <= new <= ord("Z"):
        pass
    else:
        new = new - ord("Z") + ord("A") - 1
    S_.append(chr(new))
for s in S_:
    print(s, end="")
print()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = input()
    ans = ''

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
bfs = list(input())
s = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
afs = []
for i in bfs:
    a = s.index(i)
    afs.append(s[a+n])
ans = "".join(afs)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#a=int(input())
#a,b,c=map(int, input().split())
#c=list(map(int, input().split()))
A='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N=int(input())
S=str(input())
res=''
for i in range(len(S)):
  aN=A.index(S[i])+N
  if aN>25:
    aN-=26
  res+=A[aN]

print(res)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
l =[""]*len(S)
for i in range(len(S)):

  l[i]=chr((ord(S[i])-ord('A')+N)%26+ord('A'))
print("".join(l))

Submission status: Accepted

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

a = ''

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

Submission status: Accepted

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    S = args[1]

    A = ord('A')
    AtoZ = ord('Z')-A+1

    ret = ''
    for c in S:
        ret += chr(((ord(c)-A+n) % AtoZ)+A)
    return ret


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Accepted

Solution code:
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
N = int(input())
S = input()

for c in S:
    print(alpha[(alpha.index(c) + N) % 26], end="")

print()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    s = list(input().rstrip())

    ans = ""

    for x in s:
        i = ord(x) + n
        if i > 90:
            i = i - 26

        ans += chr(i)

    print(ans)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding:utf-8
N = int(input())
S = input()

ans = ''

for char in S.lower():
    num = ord(char)
    num -= 97
    num = (num + N) % 26
    num += 97
    ans += chr(num)

print(ans.upper())

Submission status: Accepted

Solution code:
# coding: utf-8
num = int(input())
target = input()

def next_char(c, n):
    tmp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    new = tmp.find(c) + n
    if new >= 26:
        new -= 26
    return tmp[new]

out = ""
for i in range(len(target)):
    new_char = next_char(target[i], num)
    out = out + new_char

print(out)

Submission status: Accepted

Solution code:
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"]
dic = {}
for i in range(len(alp)):
    dic[alp[i]]=i#A->0

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

s = ""

for i in range(len(S)):
    num = (int(dic[S[i]])+N)%26
    s+=alp[num]
    
print(s)

Submission status: Accepted

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

al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for i in range(len(S)):
    for j in range(26):
        if S[i] == al[j]:
            if j + N < 25:
                S[i] = al[j+N]
            else:
                S[i] = al[j+N-26]
            break

mojiretsu = ','.join(S)
print(str(mojiretsu).replace(',', ''))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
A = []
for i in range(len(S)):
    A.append(chr(65 + ((ord(S[i]) - 65 + N) % 26)))

print("".join(A))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
for i in range(len(s)):
    asc = ord(s[i])
    if asc <= 90 - n:
        asc += n
        s = s[:i] + chr(asc) + s[i+1:]
    else:
        asc = 65 + (asc + n - 90) - 1    
        s = s[:i] + chr(asc) + s[i+1:]
print(s)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

S = [(x + N) % 26 for x in S]

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

Submission status: Accepted

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

codes = []

henkan = []

s = ""

for i in range(len(S)):
    codes.append(ord(S[i])-ord("A"))

for i in range(len(S)):
    henkan.append((codes[i] + N)%26 + ord("A"))

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

print(s)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
for i in range(len(S)):
    s = S[i]
    if ord(s)+N >= 91:
        ss = chr(ord(s) + N-26)
        #print(ss)
        S[i] = ss
    else:
        #print(ord(s)+N)
        ss = chr(ord(s)+N)
        #print(ss)
        S[i] = ss
print(''.join(S))

Submission status: Accepted

Solution code:
# -*- Coding: utf-8 -*-

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

def _rot13(c):
    if 'A' <= c and c <= 'Z':
        # 13 文字分ずらす
        return chr((ord(c) - ord('A') + n) % 26 + ord('A'))

    if 'a' <= c and c <= 'z':
        # 13 文字分ずらす
        return chr((ord(c) - ord('a') + n) % 26 + ord('a'))

    # その他の文字は対象外
    return c


def rot13(ss):
    # ジェネレータ内包表記で文字列に ROT13 を適用する
    g = (_rot13(c) for c in ss)
    # 文字列に直す
    return ''.join(g)


print(rot13(s))

Submission status: Accepted

Solution code:
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','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:
  ans.append(l[l.index(i)+n])

  
for i in range(len(ans)):
  print(ans[i], end = '')

Submission status: Accepted

Solution code:
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n = ni()
s = ns()

for si in s:
    num = ((ord(si) - ord("A") + n) %26) + ord("A")
    print(chr(num), end="")

Submission status: Accepted

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

alphabet = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")

ans_list = []
for s in S: 
    ans_list.append(alphabet[alphabet.index(s)+N])
print("".join(ans_list))

Submission status: Accepted

Solution code:
def main():
    n, s = int(input()), input()
    l = [chr(i) for i in range(65, 65+26)]
    sl = []
    for si in s:
        sl.append(l.index(si))
    l = l+l
    sl = list(map(lambda x: x+n, sl))
    o = [l[i] for i in sl]
    print("".join(o))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N=int(input())
S=input()
SO=""
for i in range(len(S)):
  a = ord(S[i]) + N
  if ( a > ord('Z') ):
    a = ord('A') + (a-ord('Z')-1)
  SO += chr(a)
print(SO)

Submission status: Accepted

Solution code:
n = int(input())
s = list(str(input()))

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


ans = ''

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

print(ans)

Submission status: Accepted

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


for s in S:
    ans = ord(s) + N

    if ans > 90:
        ans = (ans - 91) + 65

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

Submission status: Accepted

Solution code:
N=int(input())
S=str(input())
L="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
s=""
for j in S:
  if L.index(j)+N<=len(L)-1:
    s+=L[L.index(j)+N]
  else:
    s+=L[L.index(j)+N-len(L)]
print(s)

Submission status: Accepted

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

al = [chr(i) for i in range(65, 65+26)]
res_list = []
for s in S:
    tidx = al.index(s)
    if 0 <= tidx+N <=25:
        # print(al[tidx+N])
        res_list.append(al[tidx+N])
    else:
        # print(al[abs(25-(tidx+N)) - 1])
        res_list.append(al[abs(25-(tidx+N)) - 1])
print(''.join(res_list))

Submission status: Accepted

Solution code:
import sys
import math
import bisect
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


# A
def A():
    s = input()
    if s == 'SUN':
        print(7)
    if s == "MON":
        print(6)
    if s == "TUE":
        print(5)
    if s == "WED":
        print(4)
    if s == "THU":
        print(3)
    if s == "FRI":
        print(2)
    if s == "SAT":
        print(1)
    return


# B
def B():
    al = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    n = I()
    s = S()
    for i in range(len(s)):
        ni = (al.index(s[i]) + n) % 26
        s[i] = al[ni]
    print(''.join(s))
    return


# C
def C():
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Unittest
def resolve():
    B()
    return


# Solve
if __name__ == "__main__":
    B()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
li = [chr(i) for i in range(65,65+26)]

def shift(l, k):
  return l[k:] + l[:k]

lish = shift(li,n)
ans = ""
for i in range(len(s)):
  ans += lish[li.index(s[i])]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ans = ''

for _s in s:
    asc = ord(_s)
    asc += n
    if asc > 90:
        asc -= 26
    ans += chr(asc)
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
t=[]
u=[]
alpha2num = lambda c: ord(c) - ord('A') + 1
num2alpha = lambda c: chr(c+64)


for i in range(len(s)):
  t.append(alpha2num(s[i]))

for i in range(len(t)):
  t[i]+=n

  if t[i]>26:
    t[i]-=26
  u.append(num2alpha(t[i]))

mojiretu = ''.join(u)
print(mojiretu)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
t =''
for c in s:
    temp = ord(c) + n
    if temp>90:temp-=26
    t = t + chr(temp)
print(t)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
b = input()

s = ["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(b)):
    index = s.index(b[i])
    out += s[(index+a) % 26]

print(out)

Submission status: Accepted

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

abc = [chr(ord('a') + i) for i in range(26)]
ans = []

for c in S:
    ans.append(chr((ord(c)+N-65)%26 + 65))
ans = "".join(ans)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
result = []
for i in range(len(s)):
    result.append(chr((ord(s[i]) - ord('A') + int(n)) % 26 + ord('A')))

print(''.join(result))

Submission status: Accepted

Solution code:
n = int(input())
word = input()

ans = ''

for i in word:
    askey = ord(i)
    askey += n
    if askey > 90:
        askey = 64 + askey - 90
    ans += chr(askey)

    
print(ans)