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:
a = [chr(i) for i in range(65, 65+26)]
n = int(input())
s = input()
ans = ''
for i in s:
    ans += (a[(a.index(i)+n)%26])
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
T = ''
for i in S:
    if (ord(i)-64+N)%26 != 0:
        T += chr((ord(i)-64+N)%26 + 64)
    else:
        T += 'Z'
print(T)

Submission status: Accepted

Solution code:
from functools import reduce

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

ans = [chr(ord("A") + (ord(s) + N - ord("A"))%26) for s in S]

ans = reduce(lambda x, y: x + y, ans)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

ans=""
for x in S:
  if ord("Z")<ord(x)+N:
    ans+=chr(ord(x)+N-26)
  else:
    ans+=chr(ord(x)+N)

print(ans)

Submission status: Accepted

Solution code:
from string import ascii_uppercase as au

N = int(input())
S = input()
ans = ''
for s in S:
	idx = (au.index(s) + N) % len(au)
	ans += au[idx]
print(ans)

Submission status: Accepted

Solution code:
num_a = ord("A")
num_z = ord("Z")

N = int(input())
S = input()
ans = ""
for char in S:
  tmp = N + ord(char)
  if tmp > num_z:
    ans += chr(tmp-26)
  else:
    ans += chr(tmp)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
answer = ""
# アルファベットは26文字,Zの次はAにループするのでoed()で
# UniCode変換後にNを足し、それを%26を行った値を足す
for word in S:
    answer += chr( ord("A") + (ord(word)-ord("A")+N)%26 )

print(answer)

# //////////////////////////////////////////////////
# // ループさせる問題はループの個数の除算分で制御する //
# // 今回はAに,Aと文字の差にずらした分を26で除算する //
# //  ord()←→chr()でそれぞれUniCodeを経て変換可能　 //
# /////////////////////////////////////////////////

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in s:
    ascii_code = (ord(i) + n)
    if ascii_code >= 91:
        ascii_code -= 26

    ans += chr(ascii_code)

print(ans)

Submission status: Accepted

Solution code:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq

n = ni()
s = input()
def wid(w):
    return ord(w)-ord("A")
def ws(wid):
    return chr(wid+ord("A"))
ans = ""
for i in range(len(s)):
    id = (wid(s[i])+n)%26
    ans+=ws(id)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    # n, k = map(int, input().split())
    # h = list(map(int, input().split()))
    s = input()

    ans = ""

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def f(s, n):
    ans = ''
    for c in s:
        ans += chr(ord('A') + (ord(c)-ord('A')+n) % 26)
    return ans

N = int(input())
S = input()
print(f(S, N))

Submission status: Accepted

Solution code:
def rot_n(s, n):
  answer = ''
  for letter in s:
      answer += chr(ord('A') + (ord(letter)-ord('A')+n) % 26)

  return answer

### https://qiita.com/TodayInsane/items/94f495db5ba143a8d3e0

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

print(rot_n(S, N))

Submission status: Accepted

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

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

print(''.join(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=input()
c=[]
d=[]
e=""
for i in range(len(b)):
  c.append(ord(b[i]))
for i in range(len(b)):
  d.append((int(c[i])+a-65)%26+65)
for i in range(len(b)):
  e=e+chr(d[i])
print(e)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in S:
    print(abc[(abc.index(i)+N)%len(abc)], end = "")

Submission status: Accepted

Solution code:
num = int(input())

node = input()
table = list(node)


for i in table:
    aaa = ord('A') + ((ord(i) - (ord('A')) + num) % 26)
    print(chr(aaa), end='')

Submission status: Accepted

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

Submission status: Accepted

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

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

for x in s:
  number = mozi.index(x) + n
  if number > 25:
    number = number - 26
  print(mozi[number], end="")

Submission status: Accepted

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

ans = ''
Z_s = 'Z'
for i in range(len(S)):
    ord_s = ord(S[i]) + N
    if ord_s > ord(Z_s):
        ord_s -= ord('Z') - ord('A') + 1
    ans += chr(ord_s)
print(ans)

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)):
    if ord(s[i])+n>90:
        ans  += chr(ord(s[i])+n-26)
    else:
        ans  += chr(ord(s[i])+n)
print(ans)

Submission status: Accepted

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

alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans=""
for i in range(len(S)):
    for j in range(26):
        if alpha[j]==S[i]:
            index=(j+N)%26
            ans+=alpha[index]
            break
print(ans)

Submission status: Accepted

Solution code:
import string

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

# string.ascii_uppercase を覚えよう
a = string.ascii_uppercase
# a = ABCDEFGHIJKLMNOPQRSTUVWXYZ

ans = ''
for s in S:
  num = (a.index(s) + N) % len(a)
  ans += a[num]
  
print(ans)

Submission status: Accepted

Solution code:
import string

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

a = string.ascii_uppercase
# a = ABCDEFGHIJKLMNOPQRSTUVWXYZ

ans = ''
for s in S:
  ans += a[(a.index(s) + N) % len(a)]
  
print(ans)

Submission status: Accepted

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

a = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
ans = ''
for s in S:
  num = a.index(s) + N
  if num <= 25: ans += a[num]
  else: ans += a[num-26]
  
print(ans)

Submission status: Accepted

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

a = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
ans = ''
for i in range(len(S)):
  ans += a[a.index(S[i]) + N]
  
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

print("".join(chr(65+(ord(s)-65+N)%26) for s in S))

Submission status: Accepted

Solution code:
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

print(''.join(ans))

Submission status: Accepted

Solution code:
n = int(input())
list_s = list(input())
for i in range(0, len(list_s)):
    tmp = ord(list_s[i]) + n
    if tmp > ord("Z"):
        tmp -= 26
    list_s[i] = chr(tmp)
print("".join(list_s))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
S=input()
ans = ""
for s in S:
  if (ord(s)+n) > 90:
    ans += chr(64+((ord(s)+n)%90))
  else:
    ans += chr(ord(s)+n)
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
a="abcdefghijklmnopqrstuvwxyz".upper()*2

for i in s:
    b=a[a.index(i)+n]
    print(b,end="")

Submission status: Accepted

Solution code:
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
N = int(input())
S = input()
ans = ""
for i in range(len(S)):
  x = alphabet.index(S[i])
  if x + N >= 26:
    y = x + N -26
  else:
    y = x + N
  ans += alphabet[y]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
T = ""
char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
char2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(S)):
    for j in range(26):
        if S[i] == char[j]:
            T += char2[j + N]
            break
print(T)

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 1
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()


n = k()
S = list(v())

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

print("".join(S))

Submission status: Accepted

Solution code:
ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

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

Submission status: Accepted

Solution code:
# 与えられた数値の桁数と桁値の総和を計算する.
def calc_digit_sum(num):
    digits = sums = 0
    while num > 0:
        digits += 1
        sums += num % 10
        num //= 10
    return digits, sums


n = int(input())
s = [((ord(ch) - 65 + n) % 26) + 65 for ch in input()]
print("".join(map(chr, s)))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import string
N = int(input())
S = input()
ascii_uppercase = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
for s in S:
    s_index = ascii_uppercase.index(s)
    ans_index = (s_index + N) % len(ascii_uppercase)
    print(ascii_uppercase[ans_index], end="")

Submission status: Accepted

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


for i in range(len(S)):
    S[i] = ord(S[i])

for i in range(len(S)):
    if S[i] + N <= 90:
        S[i] = chr(S[i] + N)
    else:
        S[i] = chr(64 + S[i] + N - 90)


S = ''.join(S)
print(S)

Submission status: Accepted

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

for i in range(len(s)):
    for j in range(26):
        if s[i] == alp[j]:
            s[i] = alp[j+n]
            break

print(''.join(s))

Submission status: Accepted

Solution code:
A=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
n=int(input())
s=str(input())
t=""
for i in range(len(s)):
  for j in range(26):
    if s[i]==A[j]:
      if j+n<=25:
        t+=A[j+n]
        break
      else:
        t+=A[j+n-26]
        break

print(t)

Submission status: Accepted

Solution code:
# 問題：https://atcoder.jp/contests/abc146/tasks/abc146_b

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

res = ''

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

print(res)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
t = ""
for i in s:
  a = ord(i) + n
  if a > ord("Z"):
    a = a - 26
  t += chr(a)
print(t)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = ['' for _ in range(len(S))]
a = ord('A')
for i, c in enumerate(S):
    ans[i] = chr((ord(c) - a + N) % 26 + a)
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
revALPH = "".join(list(reversed("ABCDEFGHIJKLMNOPQRSTUVWXYZ")))
A = ""

for s in S:
    pos = revALPH.find(s)
    A += revALPH[pos - N]

print(A)

Submission status: Accepted

Solution code:
alpha = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = list(input())
for i in S:
  idx = alpha.index(i)
  n_idx = (idx + N) % 26
  print(alpha[n_idx],end="")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = ''
for s in S:
    i = ord(s)+N
    if i >= 65 + 26:
        i -= 26
    ans += chr(i)
print(ans)

Submission status: Accepted

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

#print(ord("A"))
#print(ord("B"))
#print(ord("Z"))

for i in range(len(S)):
	ascii = ord(S[i]) + N   #Sのi文字目のアスキーコードを計算してしれにNを足してづらす
	if ascii > ord("Z"):    #アスキーコードがよりも大きくなった時はA初まりにづらす
		ascii = ascii - (ord("Z") - ord("A") + 1)
	print(chr(ascii),end = "") #,end = "" は１行ごとに改行しないでプリントする仕組み

Submission status: Accepted

Solution code:
import sys

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


def main():
    from string import ascii_uppercase

    N = int(readline())
    S = input()
    res = ""

    for char in S:
        idx = ascii_uppercase.index(char)
        res += ascii_uppercase[(idx + N) % 26]

    print(res)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
al=list(alphabet)
S=list(input())
ans=""
for i in range(len(S)):
    x=al.index(S[i])+N
    ans+=al[x%26]
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
S=list(map(str, input()))
li=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
answer=[]
for i in range(len(S)):
  for j in range(len(li)):
    if S[i]==li[j] and j<len(li)-N:
      answer.append(li[j+N])
    elif S[i]==li[j] and j>=len(li)-N:
      answer.append(li[j+N-len(li)])
print("".join(answer))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
newS = ''
A = ord('A')
Z = ord('Z')
for k in range(len(S)):
    if ord(S[k]) + N > Z:
        newS += chr(ord(S[k]) + N - Z + A - 1)
    else:
        newS += chr(ord(S[k]) + N)
print(newS)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify

import itertools
import math, fractions
import sys, copy

def L(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline().rstrip())
def SL(): return list(sys.stdin.readline().rstrip())
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def R(n): return [sys.stdin.readline().strip() for _ in range(n)]
def LR(n): return [L() for _ in range(n)]
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def LIR1(n): return [LI1() for _ in range(n)]
def SR(n): return [SL() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]

def perm(n, r): return math.factorial(n) // math.factorial(r)
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))

def make_list(n, *args, default=0): return [make_list(*args, default=default) for _ in range(n)] if len(args) > 0 else [default for _ in range(n)]

dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
alphabets = "abcdefghijklmnopqrstuvwxyz"
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
MOD = 1000000007
INF = float("inf")

sys.setrecursionlimit(1000000)

def main():
    N = I()
    S = SL()

    for ch in S:
        print(ALPHABETS[(ALPHABETS.find(ch) + N) % len(ALPHABETS)], end="")
    print()

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, S: str):
    return "".join(chr((ord(c) - ord('A') + N) % 26 + ord('A')) for c in S)


def main():

    sys.setrecursionlimit(10 ** 6)

    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
    print(f'{solve(N, S)}')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import string

N=int(input())
S=input()
A=string.ascii_letters.upper()

T=""
for s in S:
    T+=A[(A.index(s)+N)%26]
print(T)

Submission status: Accepted

Solution code:
data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#print(ord("A"))
#print(ord("Z")-65)

n=int(input())
a=input()
ans=""
for i in a:
  p = (ord(i)-65+n)%26
  ans+=data[p]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

S = input()
s = list(S)
l = len(s)



B = []

for i in range(l):
  c = ord(s[i])
  e = c+N
  if e>ord('Z'):
    e = e - 26
  d = chr(e)
  B.append(d)
    
b = ''.join(B)

print(b)

Submission status: Accepted

Solution code:
word = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
s = input()
answer = ''
for i in range(len(s)):
    iti = word.find(s[i])
    if iti + n + 1 > len(word):
        answer += word[iti+n-len(word)]
    else:
        answer += word[iti+n]
print(answer)

Submission status: Accepted

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

A = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

T = str.maketrans(A, A[N:] + A[:N])

print(S.translate(T))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
x = len(s)
for i in range(x):
  a = s[i]
  b = ord(a)
  c = ord("A")
  d = (b + n - c)%26
  print(chr(c + d), end = '')
print()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
ans = ''
for i in S:
    ans = ans + chr(65 + (ord(i) + N - 65)%26)

print(ans)

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

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

    print(*s, sep="")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
s = input()
ans = []
for i in range(len(s)):
    for j in range(len(alpha)):
        if s[i] == alpha[j]:
            if j+n<25:
                ans.append(alpha[j+n%26])
            else:
                ans.append(alpha[n%26-(26-j)])
print("".join(ans))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
result = ''
for i in S:
    ind = A.index(i)
    ind += N
    if ind > 25:
        ind -= 26
    result += A[ind]
print(result)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
T = ''
for i in S:
	ind = A.index(i)
	ind += N
	if ind > 25:
		ind -= 26
	T += A[ind]
print(T)

Submission status: Accepted

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

Submission status: Accepted

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

print(S)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

l = []
for i in S:
    if ord(i)+N > 90:
        l.append(chr(64+(ord(i)+N)%90))
    else:
        l.append(chr(ord(i)+N))

print("".join(l))

Submission status: Accepted

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

ans=""

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    N = I()
    S = _S()
    alpha = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    ans = ""
    for s in S:
        ind = (alpha.index(s)+N) if (alpha.index(s)+N)<26 else (alpha.index(s)+N)-26
        ans += alpha[ind]
    print(ans)


main()

Submission status: Accepted

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

tmp = []
for s in S:
    if ord(s)+n > ord('Z'):
        tmp.append(ord('A')+(ord(s)+n)%ord('Z')-1)
    else:
        tmp.append(ord(s)+n)

ans = ''
for i in tmp:
    ans += chr(i)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ali = []
for i in range(52):
    if i <= 25:
        ali.append(chr(ord("A")+i))
    else:
        ali.append(chr(ord("A")+i-26))
#ここから
n = int(input())
s = input()
news = ""
for i in range(len(s)):
    news += ali[ali.index(s[i]) + n]
print(news)

Submission status: Accepted

Solution code:
n=int(input())
a=input()
L=[]
for i in range(26):
    L.append(chr(65+i))
news=''
for i in range(len(a)):
    if L.index(a[i])+n>25:
        news+=L[L.index(a[i])+n-26]
    else:
        news+=L[L.index(a[i])+n]
        



print(news)

Submission status: Accepted

Solution code:
n=int(input())
a=input()
L=[]
for i in range(26):
    L.append(chr(65+i))
news=''
for i in range(len(a)):
  news+=L[L.index(a[i])+n-26]
print(news)

Submission status: Accepted

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

plus = N % 26
result = ''
for c in S:
    next = ord(c) + plus
    result += chr(next - 26) if next > 90 else chr(next)
print(result)

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
S = input()
tmp = string.ascii_uppercase

ans = []
for s in S:
    i = string.ascii_uppercase.index(s)
    if i+n > 25:
        ans.append(tmp[i+n-26])
    else:
        ans.append(tmp[i+n])

print(''.join(ans))

Submission status: Accepted

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

l=[]

for a in s:
  moji=ord(a)
  moji+=n

  if int(moji)>90:
    moji-=26

  l.append(chr(moji))

print(''.join(l))

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())
s = str(input())
new = []

ntr = n % 26

for p in range(len(s)):
    k = ord(s[p]) + ntr
    if k > 90:
        k = k - 90 + 64
    new.append(chr(k))

x = "".join(new)
print(x)

Submission status: Accepted

Solution code:
import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
w = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
t = ""
for i in range(len(s)):
    for h in range(26):
        if s[i] == w[h]:
            t += w[h+n]
            break
print(t)

Submission status: Accepted

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

Submission status: Accepted

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

ans = ''
for si in s:
    num = ord(si)+n
    if num > ord('Z'):
        ans += chr(num-26)
    else:
        ans += chr(num)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
L = [chr(ord("A")+i) for i in range(26)]
X = ""
for i in S:
    a = L.index(i) + N
    if a >= 26:
        a = a - 26
        X += L[a]
    else:
        X +=  L[a]
print(X)

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
s = input()
ans = ''
for t in s:
    st = ord(t) + n
    if(st > ord('Z')):
        st = ord('A') + st - ord('Z') - 1
    ans = ''.join([ans, chr(st)])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

for i in range(len(s)):
    if ord(s[i])+N-ord('A') < 26:
        s[i] = chr(ord(s[i])+N)
    else:
        s[i] = chr(ord(s[i])+N-26)
print(''.join(s))

Submission status: Accepted

Solution code:
n=int(input())
s=input()
l=[]
for i in s:
    x=(ord(i)-65+n)%26
    y=chr(65+x)
    l.append(y)
print(''.join(l))