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:
N=int(input())
S=list(input())
ans=''
for st in S:
    if((ord(st)+N) > 90):
        ans+=chr(65+((ord(st)+N-1)-90))
    else:
        ans+=(chr(ord(st)+N))
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
l=list(input())
kk=[]
a=0
A=ord("A")
Z=ord("Z")
for i in l:
  a=ord(i)+n
  if a<=Z:
    kk.append(chr(a))
  elif a>Z:
  	kk.append(chr(a-Z+A-1))
print("".join(kk))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()

alphas = [chr(x) for x in range(65, 65 + 26)]

new = str()

for i in range(len(s)):
    aI = alphas.index(s[i])
    if aI + n >= 26:
        b = aI + n - 26
        new += alphas[b]
    else:
        new += alphas[aI + n]

print(new)

Submission status: Accepted

Solution code:
N=int(input())
S=list(input())
ans=''
for st in S:
    if((ord(st)+N) > 90):
        ans+=chr(65+((ord(st)+N-1)-90))
    else:
        ans+=(chr(ord(st)+N))
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ans = [0]*len(s)

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
for i in S:
    x = int(ord(i))
    if x + N < 91:
        print(chr(x+N),end="")
    else:
        print(chr(x+N-26),end="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
alpha_list = list(alpha)
s_num = [alpha_list.index(i) for i in s]
ans_num = [(i + n) % 26 for i in s_num]
ans_list = [alpha_list[i] for i in ans_num]
ans = "".join(ans_list)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
for i in range(len(s)):
  x = ord(s[i])
  if x+n < 91:
  	print(chr(x+n), end='')
  else:
    print(chr(x+n-26), end='')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
inc = 0
res = ''

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
a = ''
for i in range(0,len(s)):
   cc = 65+ (ord(s[i]) + n - 65)%26
   a += chr(cc)

print(a)

Submission status: Accepted

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

for i in range(len(s)):
    if ord(s[i])+n >= 91:
        s[i] = chr(ord(s[i])+n-26)
    else:
        s[i] = chr(ord(s[i])+n)
    

print("".join(s))

Submission status: Accepted

Solution code:
#import math
#import bisect
#import numpy as np
#import itertools
#import copy
import sys

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

def main():
    n = int(input())
    s = input()
    l = len(s)
    a = [0] * l

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

    print(''.join(a))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ans=[]
for tmp in s:
    ans.append(chr(((ord(tmp)-65+n) % 26)+65))
print(*ans,sep="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
result = ""
for i in range(len(S)):
    diff = ord(S[i]) + N
    if diff > 90:
        diff -= 90
        diff += 64
    result += chr(diff)
print(result)

Submission status: Accepted

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

for i in range(len(S)):
    for j in range(len(alphabet)):
        if S[i] == alphabet[j]:
            S[i] = j

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"

ans = ""
for i in s:
    index = alpha.find(i)
    ans += alpha[index + n]
print(ans)

Submission status: Accepted

Solution code:
Num=int(input())
Str=input()

Letters =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'.split())

Ans=''
for i in range(len(Str)):
  Index = Letters.index(Str[i])
  if Index + Num < 26:
    Ans += Letters [Index + Num]
  else:
    Diff = (Index + Num) - 26
    Ans += Letters [Diff ]
  
print(Ans)

Submission status: Accepted

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

ans = ""

for i in s:
    if ord('Z') >= ord(i) + n:
        ans = ans + chr(ord(i) + n)
    else:
        ans = ans + chr(ord(i) + n - ord('Z') - 1 + ord('A'))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

def main():
    n = int(input())
    s = input()
    print("".join([n_next_moji(c, n) for c in s]))

def n_next_moji(c, n):
    for i in range(n):
        c = next_moji(c)
    return c

def next_moji(c):
    if c == "Z":
        return "A"
    return chr(ord(c) + 1)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:

n = int(input())
s = input()
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
x = ""
for i in s:
    x += a[a.index(i)+n]
print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string
A2Z = string.ascii_uppercase

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

res = ''
for i in range(len(S)):
    index = A2Z.index(S[i])
    res += A2Z[(index+N)%26]
print(res)

Submission status: Accepted

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

temp = ord(s[0])
next = temp + num

if next>ord('Z'):
  next = next -ord("Z")-1+ord("A")

s_new = chr(next)

for i in range(1,len(s)):
  temp = ord(s[i])
  next = temp + num
  
  if next>ord('Z'):
    next = next -ord("Z")-1+ord("A")
   
  s_new = s_new + chr(next)

  
print(s_new)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
sLst = list(input())
alphaLst = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
ans = str()

if n == 26:
    n = 0

for s in sLst:
    idx = alphaLst.index(s) + n
    if idx >= 26:
        idx -= 26
    ans = ans + alphaLst[idx]

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = ''
for i in S:
    if ord(i)+N <= 90:
        ans += chr(ord(i)+N)
    else:
        ans += chr(ord(i)+N-26)
print(ans)

Submission status: Accepted

Solution code:
def main(n,s):
    res = ""
    for i in range(len(s)):
        val = ord(s[i])+n
        if val > ord("Z"):
            val -= 26
        res += chr(val)
    return res

n = int(input())
s = input()
print(main(n,s))

Submission status: Accepted

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

for i in s:
  temp = ord(i) + n
  if temp >= 91:
    temp -= 26
  ans += chr(temp)
print(ans)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n=int(input())
    lst=list(input())
    min_num=ord("A")
    for c in lst:
        cooked_num=ord(c)-min_num+n
        if(cooked_num>=26):
            print(chr(cooked_num-26+min_num),end="")
        else:
            print(chr(cooked_num+min_num),end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
S=input()
B=""
for i in range(len(S)):
   C=ord(S[i])+N
   if C>90:
       C=C-26
   else:
       C=C
   B=B+chr(C) 
print(B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
answer = [0]*len(s)
for i in range(len(s)):
    tempnum = ord(s[i])
    tempnum += n
    if tempnum > 90:
        tempnum -= 26
    answer[i] = chr(tempnum)
print("".join(answer))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
arr = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
c = ""
for s in S:
    c = c + arr[arr.find(s)+N:arr.find(s)+N+1]
print(c)

Submission status: Accepted

Solution code:
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)
    ans="".join(c)
    return ans

if __name__=="__main__":
    n = int(input())
    s=list(input())
    answer=rot(s,n)
    print(answer)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
ln = len(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",
]
 
ans = []
for i in range(ln):
    ind = alph.index(s[i])
    newind = ind + n
    if newind > 25:
        newind = newind - 26
    ans.append(alph[newind])
 
print("".join(ans))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, S: str):
    ord("Z")
    result = ""
    for s in S:

        if ord(s) + N > ord("Z"):
            result += chr(ord(s) + N - 26)
        else:
            result += chr(ord(s) + N)
    print(result)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, S)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

res = ""
for i in s:
    if ord(i) + n > ord("Z"):
        res += chr(ord(i) + n - 26)
        continue 
    res += chr(ord(i) + n)
    
print(res)

Submission status: Accepted

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

for i in s:
    ord_s = ord(i)
    if ord_s + n <= 90:
        chr_s = chr(ord_s + n)
    else:
        chr_s = chr(ord_s + n - 26)
    print(chr_s, end = "")

Submission status: Accepted

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

letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
result =""
for i in s:
    a = letters.find(i) + n
    result = result + letters[a]
    
print(result)

Submission status: Accepted

Solution code:
n= int(input())
s = input()
al='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
print(''.join([al[-len(al)+al.index(i)+n] for i in s]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import string

N=int(input())
S=input()
#print(chr(65))
for i in range(len(S)):
    if ord(S[i])+N<=90:
        print(chr(ord(S[i])+N),end='')
    else:
        print(chr(ord(S[i])+N-26),end='')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
l = len(s)
ans = ""
z = ord("Z")
for i in range(l):
    k = ord(s[i]) + n
    if k > z:
        k = k - z + (ord("A") - 1)
    ans = ans + chr(k)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
N = N%26

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

Submission status: Accepted

Solution code:
N = int(input())
st = input()
ans_st = ""

for i in range(len(st)):
  ch_ord = ord(st[i])
  if ch_ord + N > 90:
    ans_st += chr(ch_ord + N - 26)
  else:
    ans_st += chr(ch_ord + N)
print(ans_st)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(''.join([d[(d.index(i) + n) % 26] for i in s]))

Submission status: Accepted

Solution code:
import string

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

a = string.ascii_uppercase
print("".join([a[(a.index(c) + n) % 26] for c in s]))

Submission status: Accepted

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

A_Z = [chr(ord('A') + i) for i in range(26)]

for i in range(len(s)):
    idx = A_Z.index(s[i])
    if idx + n > 25:
        ret = (idx + n) % 26
        rep = A_Z[ret]
        s[i] = rep
    else:
        rep = A_Z[idx + n]
        s[i] = rep
print(''.join(s))

Submission status: Accepted

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

i = ord("A")
e = ord("Z")

for s in S:
    if ord(s) + N > e:
        c = ord(s) + N - e + i - 1
    else:
        c = ord(s) + N

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

Submission status: Accepted

Solution code:
N=int(input())
S=input()
S2 = ""
for i in list(S):
	C = chr(ord(i) + N)
	if chr(ord(i) + N) > "Z":
		C = chr(ord(C) - ord("Z") + ord("A") - 1)
	S2 += C
print(S2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
S = []
for i in s:
    S.append(chr(((ord(i) - ord('A') + n) % 26 + ord('A'))))
print(*S,sep='')

Submission status: Accepted

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

h = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"
h = h.upper()
ans = str("")

for i in range(len(s)):
    for j in range(26):
        if s[i] == h[j]:
            ans +=h[j+n]
            continue

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N=int(input())
S=str(input())
alpha_lst=[]
for i in range(len(S)):
    alpha_lst.append(int(alpha.index(S[i]))+1)
    alpha_lst[i]=(alpha_lst[i]+N-1)%26
for i in range(len(S)):
    print(alpha[alpha_lst[i]],end='')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# https://atcoder.jp/contests/abc146/tasks/abc146_b

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def rot(S, N):
  A = []
  P = []
  for i in range(len(S)):
    A.append(ord(S[i]) - ord('A'))
    A[i] = (A[i] + N) % 26
    P.append(chr(ord('A') + A[i]))
  return P
  
N = int(input())
S = input()
print(''.join(rot(S, N)))

Submission status: Accepted

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

ans=""
for x in S:
    nc=ord(x)
    nc+=N
    if nc>90:
        nc-=26
    ans+=chr(nc)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in range(len(s)):
    num = alp.index(s[i])
    num = (num + n)
    if num >= 26:
        num -= 26
    ans += alp[num]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
s= input()
ans = ""
for c in s:
  nc = ord(c)
  nc += N
  if nc > 90:
    nc -= 26
  ans += chr(nc)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
answer=''
for i in range(len(S)):
  order = (ord(S[i]) - ord('A') + N) % 26
  answer += chr(order + ord('A'))
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(S)):
    if (ord(S[i]) + N) > 90:
        print(chr(ord(S[i]) + N - 90 + 64), end="")
    else:
        print(chr(ord(S[i]) + N ), end="")

Submission status: Accepted

Solution code:
n=int(input())
for c in input():
  print(chr(65+(ord(c)-65+n)%26),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')
result = ''
for letter in S:
  result += alphabet[(alphabet.index(letter)+N)%26]
print(result)

Submission status: Accepted

Solution code:
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    N = int(input())
    S = input()
    result = ''
    for s in list(S):
        if (ord(s) + N) % 91 < 65:
            c = (ord(s) + N) % 91 + 65
        else:
            c = (ord(s) + N)
        result += chr(c)
    print(''.join(result))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
S = list(input())
def func(s, N):
    tmp = (ord(s) - ord("A") + N) % 26 + ord("A")
    return chr(tmp)
for i in S:
    print(func(i, N), end="")

Submission status: Accepted

Solution code:
n=int(input())
s=input()
abc='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

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

Submission status: Accepted

Solution code:
N=int(input())
S=str(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",]
output=""
for i in range(len(S)):
  y=S[i]
  n=s.index(y)
  n+=N
  m=n%26
  M=s[m]
  output+=M
print(output)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

def next_alphabet(ch, n):
    c = ord(ch)
    return chr(c + n - ord('Z') + ord('A')-1) if c+n>90 else chr(c+n)
  
t = [0]*len(s)
for i in range(len(s)):
    t[i] = next_alphabet(s[i],n)
print(''.join(t))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
x = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
ans = ""
for i in s:
    ans += x[(x.index(i)+n)%26]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import string
n = int(input())
s = input()
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
x = ""
for i in s:
    x += a[a.index(i)+n]
print(x)

Submission status: Accepted

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

ol = [(ord(s)+n-65)%26+65 for s in S]
st = [chr(o) for o in ol]
print(''.join(st))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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"]
ans = ""
for i in range(len(s)):
    idx = (alph.index(s[i]) + n)
    if idx > 25:
        idx -= 26
    ans = ans + alph[idx]
print(ans)

Submission status: Accepted

Solution code:
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = input()

ans = ''
for c in S:
    c_ind = alp.index(c)
    ind = c_ind + N
    if ind > len(alp)-1:
        ind -= len(alp)
    ans += alp[ind]
print(ans)

Submission status: Accepted

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

ans = ''

for s in S:
    o = ord(s) + N
    if o > 90:
        ans += chr(o - 26)
    else:
        ans += chr(o)

print(ans)

Submission status: Accepted

Solution code:
al=[chr(i) for i in range(65, 65+26)]
N=int(input())
S=list(input())

for index,num in enumerate(S):
    b=al.index(num)
    c=b+N
    if c>25:
        c-=26
    S[index]=al[c]
a="".join(S)
print(a)

Submission status: Accepted

Solution code:
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"]
newS=[]
for i in range(len(S)):
  for r in range(len(A)):
    if S[i]==A[r]:
      a=r+N
      if (r+N)%25==0 and (r+N)/25!=1 and (r+N)/25!=0:
        a=24
      
      elif r+N>25:
        d=(r+N)//25
        a=(r+N)%25-(1*d)
      newS.append(A[a])
for h in range(len(newS)):
  print(*newS[h],end='')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
new_alpha = alpha[N:] + alpha[:N]
ans = ""
for i in range(len(S)):
    idx = alpha.index(S[i])
    ans += new_alpha[idx]
print(ans)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
n = int(input())
s = input()

word = ''

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

Submission status: Accepted

Solution code:
e = [chr(ord('A') + i) for i in range(26)]
a=int(input())
s=input()

res = []

for i in s:
    res.append(e[(e.index(i)+a)%26])

print(''.join(res))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
l = [chr(ord("A")+i) for i in range(26)]*2
for i in s:
  print(l[l.index(i)+n], end="")
print()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 65 - 90
N = int(input())
S = input()
arr = []
for s in S:

    tmp1 = ord(s)


    if tmp1 <= (90-N):
        tmp2 = tmp1 + N
    else:
        tmp2 = 64 + tmp1 + N - 90

    arr.append(chr(tmp2))

result = "".join(arr)
print(result)

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

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

if __name__=='__main__':
  main()

Submission status: Accepted

Solution code:
from string import *
N = int(input())
S = input()
ans = ""

for i in range(len(S)):
    n = ascii_uppercase.find(S[i])
    if(n+N-1 >= 25):
        ans += ascii_uppercase[n+N-26]
    else:
        ans += ascii_uppercase[n+N]
    
print(ans)

Submission status: Accepted

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


def next_large_char(char, num):
    char_code = ord(char)
    if char_code + num > 90:
        return chr(char_code + num - ord("Z") + ord("A")-1)
    else:
        return chr(char_code + num)
    

nextS = [0]*len(S)
for i in range(len(S)):
    nextS[i] = next_large_char(S[i], N)

print("".join(nextS))

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

alphabet_converter = {a: alphabet[i+N] for i, a in enumerate(alphabet[:26])}

converted_S = ''
for s in S:
  converted_S += alphabet_converter[s]
  
print(converted_S)

Submission status: Accepted

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

ciphertext = ""
key = N

for ch in list(S):
    ciphertext += chr((ord(ch) - ord('A') + int(key)) % 26 + ord('A'))

comp = "".join(ciphertext)
print(comp)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

for s in S:
    ind = strs.index(s) + N
    if ind >= 26:
        ind = ind - 26
    result += strs[ind]
print(result)

Submission status: Accepted

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

alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
out=''
for i in range(len(S)):
    for j in range(len(alphabet)):
        if S[i]==alphabet[j]:
            out= out + str(alphabet[(j+N)%(len(alphabet))])
print(out)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
s = list(input())
rot = 0
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 i in range(0, len(s)):
    rot = a.index(s[i])+N
    if rot > 25:
        rot -= 26        
    s[i] = a[rot]
print("".join(s))

Submission status: Accepted

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

ch=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
ans=""
for s in sl:
    ind=ch.index(s)
    ans+=ch[(ind+n)% 26]
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=list(map(ord,list(str(input()))))
for i in range(len(s)):
    s[i]=s[i]+n
    if s[i]>90:
        s[i]-=26
    s[i]=chr(s[i])
s=''.join(s)
print(s)

Submission status: Accepted

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

splitedInput = list(S)
wordCount = len(splitedInput)
for i in range(wordCount):
    convertAscii = ord(splitedInput[i]) + N
    if convertAscii > ord("Z"):
        convertAscii = convertAscii - ord("Z") + ord("A") - 1
    conversion = chr(convertAscii)
    codePoint.append(conversion)

ans = "".join(codePoint)
print(ans)

Submission status: Accepted

Solution code:
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-26)

print(ans)

Submission status: Accepted

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

ans = ""
for c in s:
    ord_code = ord(c)
    ord_code += n

    if ord_code > 90:
        ord_code -= 26

    ord_char = chr(ord_code)
    ans += ord_char

print(ans)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = input()

s = ""
for i in S:
	if ord(i)+N<=90:
		s = s + chr(ord(i) + N)
	else:
		s = s + chr(ord(i) + N - len(ascii_uppercase))

print(s)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
ret = []
for i in s:
  iz = ord(i) + n
  if iz > ord('Z'): iz -= 26
  ret.append(chr(iz))
print("".join(ret))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
num = []
#Aは６５番,Zは90番
for i in s:
    num.append(ord(i))

for i in range(len(num)):
    if num[i]+n>90:
        num[i] = chr(num[i]+n-90+64)
    else:
        num[i] = chr(num[i]+n)
a = ""
for i in num:
    a += i
print(a)