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:
import string

x = string.ascii_uppercase + string.ascii_uppercase
n = int(raw_input())
s = raw_input()
a = ord('A')
print ''.join([x[ord(c)-a+n] for c in s])

Submission status: Accepted

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

ab = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
d = {i:j for i,j in zip(ab,ab[n:]+ab[:n])}

print("".join([d[i] for i in s]))

Submission status: Accepted

Solution code:
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

n = int(input())
s = input()
#文字列だと一部分変更できないので配列に修正
ls = list(s)

for i in range(len(s)):
    idx = alpha.find(s[i])
    idx += n
    if idx >= 26:
        idx -= 26
    ls[i] = alpha[idx]

#配列から文字列生成
print("".join(ls))

Submission status: Accepted

Solution code:
sn = int(input())
str_ = input()

result = ''

for alphabet in str_:
  t = ord(alphabet)
  chr_int = t + sn
  if chr_int > 90:
    chr_int -= 26
  result += chr(chr_int)
print(result)

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 = input()
newS = ''
for c in S:
    newS += chr(((ord(c) - 65) + N) % 26 + 65)
print(newS)

Submission status: Accepted

Solution code:
N = int(input())
str = input()
new_str = ''
 
for x in str:
  temp = ord(x)+N
  if temp>90:
    new_str += chr(temp - 26)
  else:
    new_str += chr(temp)
 
print(new_str)

Submission status: Accepted

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

for i in s:
    for j in range(26):
        if i == alphabet[j]:
            ans += alphabet[(j + n) % 26]
print(ans)

Submission status: Accepted

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

AL = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 
      'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
L = [0 for i in range(len(S))]
for i in range(len(S)):
  for j in range(26):
    if S[i] == AL[j]:
      L[i] = j
for i in range(len(L)):
  L[i] = (L[i] + N) % 26
NS = ''
for i in range(len(L)):
  NS = NS[:] + AL[L[i]]
print(NS)

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']
N=int(input())
S=input()
ans=''
for i in S:
    ans+=alp[(alp.index(i)+N)%26]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
inp_string = input()
result = ""
for char in inp_string:
  value = ord(char)
  value += n
  if value > 90:
    value = 64 + (value - 90)
  result += chr(value)
print(result)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
A = ord('A')

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

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("A")+n-(ord("Z")-ord(i))-1)
    else:
        ans+=chr((ord(i)+n))
print(ans)

Submission status: Accepted

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

a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in s:
    ans += a[(int(a.index(i)) + n)%26]
print(ans)

Submission status: Accepted

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

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

s_ = ''
for l in s:
    s_ += letters[(letters.index(l)+n)%26]


print(s_)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alp= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(s.translate(str.maketrans(alp, alp[n:] + alp[:n])))

Submission status: Accepted

Solution code:
N = int(input())
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
print("".join([a[(a.index(s)+N)%26] for s in input()]))

Submission status: Accepted

Solution code:
N = int(input())

S = input()

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

for index in range(len(S)):
    temp =retsu[((alpha2num(S[index]) + N) % 26)]
    print(temp, end="")

Submission status: Accepted

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

st = string.ascii_uppercase

s1 = list(s)
s2 = list()
for i in range(len(s)):
    k = st.find(s1[i])
    if k>=26-n:
        k=k-26
    s2.append(st[k+n])
s2 = "".join(s2)
print(s2)

Submission status: Accepted

Solution code:
number=int(input())
day = input()

if number ==0:
  print(day)
else:
  alphabet=list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
  myIter =iter(day)
  out=list()
  for x in myIter:
    pos = alphabet.index(x)
    out.append(alphabet[pos + number])
    
  print(''.join(out))

Submission status: Accepted

Solution code:
W=["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()
T=""
for i in range(len(S)):
        k = W.index(S[i])+N
        if k>25: k=k-26
        T += W[k]
print(T)

Submission status: Accepted

Solution code:
rot = int(input())
strlist = list(input())

def shift(char, rot):
  str = ["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"]
  index = str.index(char)
  index = (index + rot) % 26
  return str[index]

ret = []
for c in strlist:
  ret.append(shift(c, rot))
 
print("".join(ret))

Submission status: Accepted

Solution code:
al = [i for i in "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"]
dic = {i:j for i,j in zip("ABCDEFGHIJKLMNOPQRSTUVWXYZ",range(26))}
n = int(input())
s = input()
ans = ""
for i in range(len(s)):
  ans += al[dic[s[i]]+n]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input().strip()
after = []
for s in S:
  x = ord(s) + N
  if x > ord('Z'):
    x = x - 26
  after.append(chr(x))
print(''.join(after))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
hoge=[]
Alphas='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
for a in S:
  for i, Alpha in enumerate(Alphas):
    if Alpha == a:
      hoge.append(Alphas[(i+N)%26])
      break
mojiretsu=''
for x in hoge:
    mojiretsu += x
print(mojiretsu)

Submission status: Accepted

Solution code:
alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n=int(input())
s=input()
ans=''
c=[]
for i in range(len(s)):
  c.append(alphabet[(n+alphabet.index(s[i]))%26])
print(''.join(c))

Submission status: Accepted

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

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

print(''.join(S_list))

Submission status: Accepted

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

a = [chr(i) for i in range(65, 65+26)]
b = [chr(i) for i in range(65+N, 65+26)]
for i in range(N):
    b.append(a[i])

a_dict = {}
for i in range(len(a)) :
    a_dict[a[i]] = b[i]
for i in range(len(S)) :
    S[i] = a_dict[S[i]]

print(''.join(S))

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
al = [chr(ord('A') + i) for i in range(26)]
dic = {chr(ord('A') + i):i for i in range(26)}
al = al[n:] + al[:n]
ans = [al[dic[i]] for i in s]
print(''.join(ans))

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
arufa = ['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)):
    for j in range(26):
        if arufa[j] == S[i] :
            p = (j + N) % 26
            ans.append(arufa[p])
print("".join(ans))

Submission status: Accepted

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

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

print("".join(S_list))

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


# rstrip().decode('utf-8')
# INF=float("inf")
#MOD=10**9+7
# sys.setrecursionlimit(2147483647)
# import math
#import numpy as np
# import operator
# import bisect
# from heapq import heapify,heappop,heappush
#from math import gcd
# from fractions import gcd
# from collections import deque
# from collections import defaultdict
# from collections import Counter
#from itertools import accumulate
# from itertools import groupby
# from itertools import permutations
# from itertools import combinations
# from scipy.sparse import csr_matrix
# from scipy.sparse.csgraph import floyd_warshall
# from scipy.sparse.csgraph import csgraph_from_dense
# from scipy.sparse.csgraph import dijkstra
# map(int,input().split())


def main():
	n=int(input())
	s=input().rstrip().decode('utf-8')
	
	al="ABCDEFGHIJKLMNOPQRSTUVWXYZ"*3
	ans=""
	
	for i in s:
		ans+=al[al.index(i)+n]
		
		
	print(ans)
	
	
	
	







if __name__ == "__main__":
		main()

Submission status: Accepted

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


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

    for s in S:
        a = ord(s) + N
        if a > ord('Z'):
            a = ord('A') + a - ord('Z') - 1
        print(chr(a), end="")



if __name__ == '__main__':
    main()

Submission status: Accepted

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

al = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
      'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
      'U', 'V', 'W', 'X', 'Y', 'Z']
d_al = {'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}

al = al[n:] + al[:n]
ans = [al[d_al[i]] for i in s]
print(''.join(ans))

Submission status: Accepted

Solution code:
n=int(input())
s=input()
l=len(s)
u=[]
for i in range(l):
  u.append(s[i])
alp=[]
d="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for j in range(26):
  alp.append(d[j])
for k in range(l):
  for h in range(26):
    if u[k]==alp[h]:
      u[k]=alp[(h+n)%26]
      break

for b in range(l):
  print(u[b], end="")

Submission status: Accepted

Solution code:
Al = [i for i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']
Num = [j for j in range(26)]
A = {key: value for key, value in zip(Al, Num)}
B = {key: value for key, value in zip(Num, Al)}
N = int(input())
S = [A[p] + N if A[p] + N < 26 else A[p] + N - 26 for p in input()]
ans = ''.join([B[q] for q in S])
print(ans)

Submission status: Accepted

Solution code:
alp_list = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S_list = list(input())
Slen = len(S_list)
S_return_list = []
for i in range(0,Slen):
  S_return_list.append(alp_list[(alp_list.index(S_list[i])+N)%26])
S_return="".join(S_return_list)
print('{}'.format(S_return))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
t="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
n=int(input())
print("".join([t[t.index(i)+n]for i in input()]))

Submission status: Accepted

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

alphabet = [chr(i) for i in range(65, 65+26)]*2
l = []
for i in range(len(s)):
    k = alphabet.index(s[i])
    l.append(k)
    
ans = []
for j in range(len(l)):
    ans.append(alphabet[l[j]+n])
    
for a in range(len(ans)):
    print(ans[a], end='')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ns = []
for i, ch in enumerate(s):
    index = ord(ch)
    index += n
    if(index>90):
        index -= 26
    ns.append(chr(index))
print("".join(ns))

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

result = []
for l in list(input()):
  c = n + az.index(l)
  if c > 25:
    c = c - 25 - 1
  result.append(az[c])

print(''.join(result))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
t = ''
for i in range(len(s)):
    num = ord(s[i])
    num += n
    if num > 90:
        num = num - 90 + 64
    t += chr(num)
print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = ""
for m in input():
    if ord(m)+n > 90:
        s += chr(ord(m)+n-26)
    else:
        s += chr(ord(m)+n)
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ns = ""
for c in s:
  asc = ord(c)+n 
  if asc > 90:
    asc -= 26
  ns += chr(asc)
print(ns)

Submission status: Accepted

Solution code:
alphabet = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

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

for char in S:
    n = alphabet.index(char)
    n_2 = n + N
    n_3 = n_2 % 26
    print(alphabet[n_3], end="")

print()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# 整数 > 整数型
def I(): return int(input())

# 整数列 '1 2 3 4' > 整数型リスト
def IsIl(): return list(map(lambda x: int(x), input().split()))

# 改行挟む整数列　'1/n 2/n 3/n' > 整数型りすと
def InIl(n): return [input() for i in range(n)]

# 整数列 '1 2' > 整数型タプル
def IsIt(): return map(lambda x: int(x), input().split())

# 改行挟む整数列　'1\n 2\n 3\n' > 整数型たぷる
def InIl(n): return map(input() for i in range(n))

# 文字列 'abcd' > 文字型リスト
def SsSl(): return list(map(lambda x: x, input()))

# 整数 '1234' > 整数型リスト

# 文字列 'aba' > 辞書（文字型:個数）{'a':2,'b':1}
def SSd():
    from collections import defaultdict
    A = input() # [int(i) for i in input().split()]
    dd=defaultdict(int)
    for a in A:
        dd[a]+=1
    return dd

#リストにn個要素を読み込む

# その他アルゴリズムテンプレート
# https://qiita.com/chun1182/items/ddf2b6cba932b2bb0d4e


def alpha2num(c):
    return ord(c) - ord('A') + 1

def num2alpha(num):
    return chr(num + ord("A") - 1)

n = I()
s = input()

ans = ''
for item in s:
    num = alpha2num(item) + n
    if num > 26:
        num -= 26
    ans += num2alpha(num)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Alphabet = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

for i in range(len(S)):
    S[i] = Alphabet[(Alphabet.index(S[i])+N)%26]

print(''.join(S))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
l=list(s)
newcome=[]
alp=[chr(ord('A') + i) for i in range(26)]
for i in l:
  a=alp.index(i)
  if (a+n)<26:
    t=alp[a+n]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))

Submission status: Accepted

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

ret = []
for c in s:
    new = ord(c) + n
    if not ord('A') <= new <= ord('Z'):
        new -= 26
    ret.append(chr(new))

print(''.join(ret))

Submission status: Accepted

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

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

def moji(c):
    m = ''
    for num,alphabet in enumerate(alp):
        if c == alphabet:
            m = alp[(num+N)%26]
    return m
S2 = '' 
s = ''   
for i in S:
    s = moji(i) 
    S2 = S2 + s

print(S2)

Submission status: Accepted

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

for i in range(len(s)):
    #print(alpha.find(s[i]))
    ans += alpha[alpha.find(s[i]) + n]

print(ans)

Submission status: Accepted

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

ret = ""
for s in list(S):
    a = ord(s)
    max_z_a = a - 26 if a + N > 90 else a
    ret += chr(max_z_a + N)
print(ret)

Submission status: Accepted

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


n = int(input())
abc_input = input()
abc_each = list(abc_input) #入力
#print (abc_each)

ans_abc = []
for abc in abc_each :
    for i,j in enumerate(abc_list) :
        if abc == j :
            num = (i+n) % 26
            ans_abc.append(abc_list[num])
            #print (abc_list[num])

answer = ''

for x in ans_abc:
    answer += x

print(answer)

Submission status: Accepted

Solution code:
k=int(input())
def rof(n):
  return (n-65+k)%26+65
s=list(map(rof,input().encode('ascii')))
for num in s:
  print(chr(num),end='')

Submission status: Accepted

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

Submission status: Accepted

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

ans = ''
for char in s:
    code = ord(char) - 65
    code = (code+n) % 26
    code = code + 65
    ans += chr(code)

print(ans)

Submission status: Accepted

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

ans=''
for s in S:
  if ord(s)+n>90:
    ans+=chr(ord('A')+n-(90-ord(s))-1)
  else:
    ans+=chr(ord(s)+n)
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
v=["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)):
    for j in range(len(v)):
        if s[i]==v[j]:
            ans.append(v[(j+n)%26])

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

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())
for i in range(len(s)):
    num = ord(s[i])+n
    if(num>90):
        s[i] = chr(num%90 + 64)
    else:
        s[i] = chr(num)
print(''.join(s))

Submission status: Accepted

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

for i in range(n):
    p = ord(s[i])
    p += k
    if p > 90:
        p -= 26
    s[i] = chr(p)
print(''.join(s))

Submission status: Accepted

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

dictionary = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

result = ""
for s in S:
	next_index = dictionary.find(s) + N
	if next_index > len(dictionary) - 1:
		next_index = next_index - len(dictionary)
	result += dictionary[next_index]

print(result)

Submission status: Accepted

Solution code:
N=int(input())
S=input()
t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"*2
ans=""
for i in S:
  ans+=t[t.index(i)+N]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

lis1 = list(map(lambda x: alpha2num(x), A))
lis2 = list(map(lambda x: (x + N) % 26, lis1))
lis3 = list(map(lambda x: x + 26 if x == 0 else x, lis2))
lis4 = list(map(lambda x: num2alpha(x), lis3))

print(''.join(lis4))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
Answer_list = []
for i in list(S):
    num = ord(i)+N
    if num >= 65 and num <= 90:
        Answer_list.append(chr(num))
    elif num > 90:
        Answer_list.append(chr(num - 26))
print(''.join(Answer_list))

Submission status: Accepted

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

m = ""
for i in range(ord('A'), ord('Z') + 1):
    m += chr(i)
S2 = []
for c in S:
    i = ord(c) - 65
    S2.append(m[(i + N) % len(m)])
print(''.join(S2))

Submission status: Accepted

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

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

Submission status: Accepted

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

out = []
for i in range(len(S)):
    for j in range(26):
        if S[i] == alf[j]:
            k = (j + N) % 26
            out.append(alf[k])

print("".join(out))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- codnig utf-8 -*-
n = int(input())
chars = list(input())

for i, c in enumerate(chars):
    code = ord(c)+n
    if code >90:
        chars[i] = chr(ord(c)+n-26)
    else:
        chars[i] = chr(ord(c)+n)
print("".join(chars))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
for i in s:
    x = ord(i) + n
    if x <= 90:
        print(chr(x), end='')
    else:
        print(chr(x+6).upper(), end='')

Submission status: Accepted

Solution code:

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

# ordで文字からunicode数字を返す
# chrでunicode数字から文字を返す

def chr_change(chr, N):
    """ print("chr is", chr)
    print("N is", N)
    print("ord(chr) is ", ord(chr))
     """
    Num_AtoZ = ord("Z") - ord("A")
    if ord(chr) + N > ord("Z"):
        chg_chr = ord(chr) + N - Num_AtoZ -1
    else:
        chg_chr = ord(chr) + N
    #print("chg_chr is", chg_chr)
    return chg_chr


for i in range(len(S)):
    tmp_chr = S[i]
    print(chr(chr_change(tmp_chr, N)), end = "")
print("\n")

Submission status: Accepted

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

def forward(s, n):
  A_id = ord('A')
  num_AtoZ = ord('Z') - ord('A') + 1
  return chr(A_id + (ord(s) - A_id + n) % (num_AtoZ))

print(''.join([forward(s, n) for s in S]))

Submission status: Accepted

Solution code:
alp_tot = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

alp_to_num = {}
num_to_alp = {}
for num, alp in enumerate(alp_tot):
    alp_to_num[alp] = num
    num_to_alp[num] = alp

n = int(input())
row = input()

ans = ''
for alp in row:
    num = (alp_to_num[alp] + n) % (len(alp_tot))
    ans += num_to_alp[num]

print(ans)

Submission status: Accepted

Solution code:
s = int(input())
n = input()
ans = [0]*len(n)
for index,i in enumerate(n):
  k = ord(i)+s
  if k <= 90:
    ans[index]=chr(k)
  else:
    ans[index]=chr(k%90+64)
print(''.join(map(str,ans)))

Submission status: Accepted

Solution code:
n=int(input())
s=input()
a="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans =""
for i in range(len(s)):
    for j in range(26):
        if s[i] == a[j]:
            ans += a[j+n]
            
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
ans = [0] * len(S)

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

for i in range(len(S)):
  alpha = S[i]
  num = alpha2num(alpha)#アルファベットを数字に置き換え
  num += N
  if num > 26:
    num -= 26
  ans[i] = num2alpha(num)#数字をアルファベットに戻す

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

Submission status: Accepted

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

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

Submission status: Accepted

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

changed = ""
for char in s:
    k = ord(char)
    if k + n > 90:
        changed += chr(k + n - 26)
    else:
        changed += chr(k + n)

print(changed)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())
S = input().strip()
abc = [i for i in string.ascii_uppercase]
ans = ""

for letter in S:
    indx = abc.index(letter) + 1
    nxt = indx + N
    if nxt <= 26:
        ans += abc[nxt - 1]
    else:
        ans += abc[nxt % 26 - 1]
print(ans)

Submission status: Accepted

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

M = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
print(''.join([M[(M.index(s) + N) % len(M)] for s in S]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string

N = int(input())
S = input()
chars = string.ascii_uppercase
print(''.join(chars[(chars.index(c) + N) % 26] for c in S))

Submission status: Accepted

Solution code:
#coding:utf8
Alphabet_List = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S_1 = list(input())
S_2 = []

for i in range(len(S_1)):
    S_2.append(Alphabet_List.index(S_1[i]))
    S_2[i] = (S_2[i] + N) % 26
    S_2[i] = Alphabet_List[S_2[i]]

S_3 = "".join(S_2)
print(S_3)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=input()
alpha2num=lambda c: ord(c) - ord("A")+1
num2alpha=lambda c: chr(c+64)

char=list(s)
for i in range(len(char)):
	alphabet=alpha2num(char[i])+n
	
	if alphabet>26:
		numalpha=num2alpha(alphabet-26)
	else:
		numalpha=num2alpha(alphabet)
	
	char[i]=numalpha

mapchar=map(str,char)
ret="".join(char)
print(ret)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
 
l = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
out = ""
 
for c in s:
    out += l[(l.index(c)+n)%26]
 
print(out)

Submission status: Accepted

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

l = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

out = ""

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

print(out)

Submission status: Accepted

Solution code:
a = int(input())
str = input()
for i in range(len(str)):
  val = ord(str[i])+a 
  if val > 90:
   	  val -=26   
  print(chr(val),end="")

Submission status: Accepted

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

Submission status: Accepted

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

newS = ""
for s in S.lower():
    s_to_num = ord(s) - 96
    if (s_to_num + N) % 26 != 0:
        new_s = chr( ( (s_to_num + N) % 26 ) + 96)
    else:
        new_s = chr( 26 + 96)
    newS += new_s
print(newS.upper())

Submission status: Accepted

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

# ord(A) -> 65, ord(Z) -> 90

ans = ""
for i in range(len(s)):
    chr_num = ord(s[i]) + n
    if chr_num > 90:
        chr_num = (chr_num % 90) + 64
    ans += chr(chr_num)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string
n = input()
s = input()
list = list(string.ascii_uppercase)
list.extend(list)
newlist = []
for al in s:
  initloc = list.index(al)
  nowloc = int(initloc) + int(n)
  
  newlist.append(list[nowloc])
print("".join(newlist))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
L = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
S = list(S)
ANS = []

for n in range(len(S)):
    new_n =(L.index(S[n]) + N)  % 26
    ANS.append(L[new_n])

print(''.join(ANS))

Submission status: Accepted

Solution code:
n=int(input())
s=str(input())
s1=''
alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in s:
  s1+=alpha[ord(i)-65+n]
print(s1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

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

s_shift_n = ''
for i in range(len(s)):
    s_shift_n += alphabet[(alphabet.index(s[i])+n)%26]

print(s_shift_n)

Submission status: Accepted

Solution code:
N = int(input())
res = ""

for i in list(input()):
    ascii = ord(i)
    n = ascii - 65
    n = (n + N) % 26
    res += chr(n + 65)
print(res)

Submission status: Accepted

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

"""
ans = ""
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for a in S:
    ans += alpha[(alpha.index(a) + N) % 26]

print(ans)

Submission status: Accepted

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

ans = ""
for a in S:
    ans += chr((ord(a) + N - ord("A")) % 26 + ord("A"))

print(ans)

Submission status: Accepted

Solution code:
alphaList = ['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']
i = int(input())
str = input()
out = ""
for s in str :
    out = out + alphaList[(alphaList.index(s) + i) % 26]
print(out)

Submission status: Accepted

Solution code:
N = int(input())
s = str(input())
"""l = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
ans = ""
for i in range(len(s)):
    ans+= l[(l.index(s[i])+N)%26]
print(ans)"""
ans = ""
for i in range(len(s)):
    ans += chr((ord(s[i]) - ord('A') + N) % 26 + ord('A'))
print(ans)