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: Wrong Answer

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

Submission status: Wrong Answer

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))

Submission status: Wrong Answer

Solution code:
num = int(input())

node = input()
table = list(node)


for i in table:
    aaa = ((ord(i)) + num) % 26
    print(chr(aaa))

Submission status: Wrong Answer

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')
    ans += chr(ord_s)
print(ans)

Submission status: Wrong Answer

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+2
    if ans >= 26:
        ans = (a+2)-26
    S[i] = AL[ans]

print("".join(S))

Submission status: Wrong Answer

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)

Submission status: Wrong Answer

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-ord('A')+1)%26)+64)
    if e == 64:
      e = 65
  d = chr(e)
  print(e)
  B.append(d)
    
b = ''.join(B)

print(b)

Submission status: Wrong Answer

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-ord('A')+1)%26)+64)
  d = chr(e)
  B.append(d)
    
b = ''.join(B)

print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = input()
al=list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
for i in s:
  s=s.replace(i, al[n+al.index(i)])
print(s)

Submission status: Wrong Answer

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'))
    else:
        tmp.append(ord(s)+n)

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

Submission status: Wrong Answer

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

l=[]

for a in s:
  moji=ord(a)
  moji+=n
  print(moji)
  if int(moji)>90:
    moji-=26

  l.append(chr(moji))

print(''.join(l))

Submission status: Wrong Answer

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

l=[]

for a in s:
  moji=ord(a)
  moji+=n
  l.append(chr(moji))

print(''.join(l))

Submission status: Wrong Answer

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

for i in range(len(s)):
    a = ord(s[i]) + n%26
    if a <= ord("Z"):
        s = s.replace(s[i], chr(a + 32))
    else:
        s = s.replace(s[i], chr(a + 6))
s = s.upper()
print(s)

Submission status: Wrong Answer

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

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

print(alp.index('F'))

for i in range(len(s)):
    s[i] = alp[(int(alp.index(s[i])) + n) % len(alp)]

print(''.join(s))

Submission status: Wrong Answer

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

ans = []

print(S)

for s in S:
  ord_plus = ord(s)+N
  if ord_plus > 90:
    ord_plus -= 26
  ans.append(chr(ord_plus))
print("".join(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
S=input()
s=[]
for i in S:
    T=ord(i) - ord('A') + 1+N+64
    if T<=90:
        t=T
    else:
        t=T-26
    s.append(chr(t))
print(*s)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
s = input()
q = [chr(i) for i in range(65,65+26)]
ans = []
for i in s:
  al = q.index(i)
  if al + n >= 26:
    al -= 26
  print(q[al],end='')

Submission status: Wrong Answer

Solution code:
# ABC146 B - ROT N
N = int(input())
S = str(input())
s=''
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']
for i in range(len(S)):
    t =alp.index(S[i])+N
    if t>=26:
        t -=26
    s += alp[t]

Submission status: Wrong Answer

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

result = ""
for s in S:
  i = alpha.index(s)
  result += alpha[i+N]
print(result)

Submission status: Wrong Answer

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

s = list(S)
for i in range(len(S)):
    if (ord(s[i]) - 64 + N) == 26:
        p = 90
    else:
        p = (ord(s[i]) - 64 + N) % 26 + 64

    s[i] = chr(p)

print("".join(s))

Submission status: Wrong Answer

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

s = list(S)
for i in range(len(S)):
    if (ord(s[i]) - 64 + N) == 26:
        p = 89
    else:
        p = (ord(s[i]) - 64 + N) % 26 + 64

    s[i] = chr(p)

print("".join(s))

Submission status: Wrong Answer

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

s = list(S)
for i in range(len(S)):
    if (ord(s[i]) - 64 + N) % 26 == 26:
        p = 89
    else:
        p = (ord(s[i]) - 64 + N) % 26 + 64

    s[i] = chr(p)

print("".join(s))

Submission status: Wrong Answer

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

s = list(S)
for i in range(len(S)):
    if ord(s[i]) + N == 90:
        p = 64 + 26
    else:
        p = (ord(s[i]) - 64 + N) % 26 + 64

    s[i] = chr(p)
    

print("".join(s))

Submission status: Wrong Answer

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

s = list(S)
for i in range(len(S)):
    if ord(S[i]) + N == 90:
        p = 64 + 26
    else:
        p = (ord(S[i]) - 64 + N) % 26 + 64

    s[i] = chr(p)
    

print("".join(s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
for i in input():
  if i=='Y': print('A', end = '')
  elif i=='Z': print('B', end = '')
  else: print(chr(ord(i) + 2), end = '')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
S = list(input())
for i in range(len(S)):
  if ord(S[i])+2 <= 90:
    S[i] = chr(ord(S[i])+N)
  else:
    S[i] = chr(ord(S[i])+N-26)
for j in S:
  print(j,end = "")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    s = input()
    ans = ""
    for i in range(len(s)):
        suuji = ord(s[i])
        tsugi = suuji + n
        if tsugi > 97+25:
            tsugi -= 26
        ans += chr(tsugi)
    print(ans)


    
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():

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

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

    print("".join(SS))










if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():

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

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



    for i in SS:
        print(i,end="")
	
    print("")







if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():

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

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



    for i in SS:
        print(i,end="")





if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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())
x=input()
X=[j for j in x]
for i in range(0,len(X)):
  n=(A.index(X[i])+N)%26
  X[i]=A[n]
print(X)

Submission status: Wrong Answer

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())
x=input()
X=[j for j in x]
for i in range(0,len(X)-1):
  n=(A.index(X[i])+N)%26
  X[i]=A[n]
print(X)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
S=input()
s=list()
for i in S:
  temp=ord(i)+2
  if temp<=ord("Z"):
    s.append(chr(temp))
  else:
    s.append(chr(temp-(ord("Z")-ord("A"))-1))
for i in s:
  print(i,end="")

Submission status: Wrong Answer

Solution code:
N=int(input())
S=input()
for i in range(len(S)):
  s=ord(S[i])+2
  print(chr(s) if s<=ord("Z") else chr(s-(ord("Z")-ord("A"))-1))

Submission status: Wrong Answer

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

if n == 0:
    print(s)

for i in range(len(s)):
    print(al[al.index(s[i]) - 26 + n])

print(s)

Submission status: Wrong Answer

Solution code:
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    s = input()
    first = ord("A") - 1
    last = ord("Z")
    increment = lambda x: chr(ord(x)+n) if ord(x)+n <= last else chr(first + (ord(x)+n - last-1))
    new_s = "".join(map(increment, s))
    print(new_s)
    


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    s = input()
    first = ord("A") - 1
    last = ord("Z")
    increment = lambda x: chr(ord(x)+n) if ord(x)+n <= last else chr(first + (ord(x)+n - last))
    new_s = "".join(map(increment, s))
    print(new_s)
    


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest
import os


# 実装を行う関数
def resolve():
    # 数値取得サンプル
    #   1行N項目 x, y = map(int, input().split())
    #   N行N項目 x = [list(map(int, input().split())) for i in range(n)]

    # 文字取得サンプル
    #   1行1項目 x = input()
    # 数値取得サンプル
    #   1行N項目 x, y = map(int, input().split())
    #   N行N項目 x = [list(map(int, input().split())) for i in range(n)]

    # 文字取得サンプル
    x = input()

    if x == "SUN":
        print(7)
    elif x == "MON":
        print(6)
    elif x == "TUE":
        print(5)
    elif x == "WED":
        print(4)
    elif x == "THU":
        print(3)
    elif x == "FRI":
        print(2)
    elif x == "SAT":
        print(1)


# テストクラス
class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """2
ABCXYZ"""
        output = """CDEZAB"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """0
ABCXYZ"""
        output = """ABCXYZ"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """13
ABCDEFGHIJKLMNOPQRSTUVWXYZ"""
        output = """NOPQRSTUVWXYZABCDEFGHIJKLM"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main()

Submission status: Wrong Answer

Solution code:
n = int(input())
S = input()
ans = []
for i in range(len(S)):
    ans.append(chr((ord(S[i])+n)%27))

print(''.join(ans))

Submission status: Wrong Answer

Solution code:
import string
n=int(input())
n=n%25
s=input()
alpha=string.ascii_uppercase
alpha+=string.ascii_uppercase+string.ascii_uppercase
#print(alpha)
for i in range(len(list(alpha))):
  if alpha[i]==s[0]:
    t=alpha[i+n:i+n+len(s)]
    break
    
    
print(''.join(t))

Submission status: Wrong Answer

Solution code:
import string
n=int(input())
n=n%25
s=input()
alpha=string.ascii_uppercase
alpha+=string.ascii_uppercase+string.ascii_uppercase
#print(alpha)
for i in range(len(list(alpha))):
  if alpha[i]==s[0]:
    t=alpha[i+n:i+n+26]
    break
    
    
print(''.join(t))

Submission status: Wrong Answer

Solution code:
n=int(input())
s=input()
t=''
for i in s:
  if ord(i)+n%25>90:
    t+=chr(ord(i)+n%25-26)
    
  else:
    t+=chr(ord(i)+n%25)
    
print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
s=input()
hiee=""
ans=""
for i in range(len(s)):
    hiee=ord(s[i])
    if (hiee+n >90):
        print("0")
        hiee-=24
    ans+=chr(hiee+n)
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
S=input()
alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans=''
for i in range(len(S)):
    ans=ans+alphabet[(alphabet.find(S[i])+N)%26]

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys

INF = float('inf')
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


n = I()
s = list(S())
s.sort()
ans = ''
for c in s:
    if ord(c) + n > ord('Z'):
        ans += chr(ord(c) + n - ord('Z') + ord('A') - 1)
    else:
        ans += chr(ord(c) + n)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys

INF = float('inf')
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


n = I()
s = list(S())
s.sort()
ans = ''
for c in s:
    if ord(c) + n > ord('Z'):
        ans += chr(ord(c) + n - ord('Z') + ord('A'))
    else:
        ans += chr(ord(c) + n)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys

INF = float('inf')
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


n = I()
s = list(S())
s.sort()
ans = ''
for c in s:
    ans += chr(ord('A') + (ord(c) - ord('A') + n) % 26)
print(ans)

Submission status: Wrong Answer

Solution code:
k = int(raw_input())
print ''.join([chr((ord(l) -ord('a') + k) % 26 + ord('a'))  for l in raw_input()])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

t=[]
for i in range(len(s)):
  num=ord(s[i])+n
  if num>122:
    num-=26
  t.append(chr(num))

print("".join(t))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# B - ROT N
# https://atcoder.jp/contests/abc146/tasks/abc146_b

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

tmp = ""

for s in S:
    print(ord(s))
    unicode_point = ord(s) + N

    if unicode_point > 90:
        unicode_point = 64 + (unicode_point - 90)

    tmp += chr(unicode_point)

print(tmp)

Submission status: Wrong Answer

Solution code:
# B - ROT N
# https://atcoder.jp/contests/abc146/tasks/abc146_b

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

tmp = ""

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

    if unicode_point >= 90:
        unicode_point = 65 + (unicode_point - 90)

    tmp += chr(unicode_point)

print(tmp)

Submission status: Wrong Answer

Solution code:
k=int(input())
s=input()
n=len(s)
temp=""
for i in range(n):
    z=ord(s[i])+k
    if z>122:
        z-=26
    temp+=chr(z)
print(temp)

Submission status: Wrong Answer

Solution code:
k=int(input())
s=input()
n=len(s)
temp=""
for i in range(n):
    z=ord(s[i])+k
    if z>123:
        z-=27
    temp+=chr(z)
print(temp)

Submission status: Wrong Answer

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

result = ''
for i in range(0,len(S)):
  num = ord(S[i])
  new = chr(num+N)
  result += new

print(result)

Submission status: Wrong Answer

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

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
from operator import itemgetter
from sys import stdin
#input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう
from operator import mul
from functools import reduce
from collections import Counter
#from collections import deque

#input = stdin.readline


j=0
k=0
n=3
r=1
a=[0]
#n=int(input())
#r=int(input())
#print(M)
#A=int(input())
#B=int(input())
#print(N)
"1行1つの整数を入力を取得し、整数と取得する"


#number_list=list(map(int, input().split(" ")))#数字の時
#print(number_list)
"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#メモ
for i in number_list:#こっちの方がrage使うより早いらしい
    print(number_list[i-1])#

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''
#array=[input().split()for i in range(N)]
#print(type(array[0][0]))
#print(array)
"正方行列にstr型の値を入力"
'''

#brray=[list(map(int, input().split(" ")))for i in range(N)]
#print(type(brray[0][0]))
#print(brray)
'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"
#以下に別解を記載
#N, M = [int(i) for i in input().split()]
'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''




#s=input()
#a=[int(i) for i in s]
#print(a[0])
#print([a])
#単数値．桁ごとに分割したい．入力と出力は以下の通り
#イメージとして1桁ごとにリストに値を入れているかんじ
#intを取ると文字列分解に使える
'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()#str style 何個でもいけることが多い
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''


#a= stdin.readline().rstrip()
#print(a.upper())
"aという変数に入っているものを大文字にして出力"


#a,b=map(int, input().split())  #int style 複数数値入力　「A B」みたいなスペース空いた入力のとき

#なんかうまく入力されるけど
#a=[[int(i) for i in 1.strip()]for 1 in sys.stdin]
#a = [[int(c) for c in l.strip()] for l in sys.stdin]]
#print(a)
#複数行の数値を入力して正方行列を作成


##############################################################################################
##############################################################################################
#under this line explains example calculation



'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''

#nCr combination
'''
def cmb(n,r):
    #When n < r , this function isn't valid
    r= min(n-r,r)
    #print(n,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    #flochart mul(n,n-1)=x
    #next     mul(x,n-2)........(n-r+1,n-r)
    #mul read a,b and returns a*b

    under = reduce(mul, range(1, r+1))
    #print(over, under)
    #reduce is applied mul(1,2)=2
    #next   mul(2,3)=6
    #next   mul(6,4)=4.........last(r!,r+1)=r+1!

    return over // under
    #// is integer divide
    #calc example 5C2
    #over=5*4*3
    #under=3*2*1
a = cmb(n, r)
#print(a)
'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD

combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''
#集計
#example
#a=[2,2,2,3,4,3,1,2,1,3,1,2,1,2,2,1,2,1]
#a=Counter(a)
for i in a.most_common(n):print(i)
#most_common()メソッドは、出現回数が多い要素順にCounterオブジェクトを並び替えます。
#引数にint型の数字nを設定した場合は、出現回数が高い上位ｎ個の要素を返します。
#何も設定しなければ、コンテナ型にあるすべての要素を出現回数の順番に並び替えたタプル型オブジェクトを返します。
#out put
#(2, 8)
 #(1, 6)
#(3, 3)
#(4, 1)
'''


#二部探索(binary search)
#A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6]
#print(A)
#index = bisect.bisect_left(A, 5) # 7 最も左(前)の挿入箇所が返ってきている
#A.insert(index, 5)
#print(index)
#print(A)
'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

'''
素数の判定
'''


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        #sqrt(n)+1以上は考えて約数はないので却下
        if n % k == 0:
            return False
            #割り切れたらFalse
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  # [1, 0, 3]

'''

def factorial(x, mod=10**9+7):
    # x!
    # 階乗
    # ex) factorial(5) = 120
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp
    '''
    Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
    But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
    '''


########################################################################
########################################################################
#b2=a[:]  #1次元のときはコピーはこれで良い
#print(b2)

#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b3=copy.deepcopy(a)  #2次元配列はこうコピーする
#print(b3)

def main():
    n=3
    steps=0
    state=0
    w=1
    j=0
    k=0
    n=int(input())
    s=input()
    ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    #a,b=input().split(" ")#a,bがともに文字列のとき
    #a,b=map(int, input().split(" "))
    #mapでとってもstrで変換すればappend可能
    #nl=list(map(int, input().split(" ")))#数字の時
    #s=input()
    a=[i for i in ascii_uppercase]#int取るとstrでも行ける
    b=[i for i in s]#int取るとstrでも行ける
    c=[]
    a.insert(0, 'AAAAA')
    #print(a)
    for i in range(len(b)):
        x=a.index(b[i])
        c.append(a[(x+n)%26])
    print(''.join(c))
    #print(a)
    #brray=[list(map(int, input().split(" ")))for i in range(N)
    #print(brray)


    for i in range(1,n+1,2):#これで1個飛ばしループになる
     pass
     #print(i)

    l = ['aaa', 'bbb', 'ccc']

    #s = ''.join(l)
    #print(s)
    # aaabbbccc

    #if state in known_states and not flag: # state => 2 steps => 5
        #こうやってある要素がリストの中にあるか探すのか
    #print(f'steps: {steps}, state: {state}')
    #こう書いてあるとデバックしやすい

    #dp= [[0]*3 for i in range(5)]#列　行
    #dp用の0の入ったやつ
    #dp= [[0]*(w+1) for i in range(n+1)]#0からwまでのw+1回計算するから
    #print(dp)＃初期条件が入る分計算回数+1列分必要(この場合は判断すべきものの数)
    DP = np.zeros(w+1, dtype=int)#これでも一次元リストが作れる
    exdp=np.zeros((3,4)) # ３×４の２次元配列を生成。2次元ならこう
    #dtypeは指定しないとfloatになる
    #for i in range(n):#ちょっとした入力に便利
    #    a, b = map(int, input().split())
        #dp[i][0] += [a]
        #これだとintとlistをつなぐことになって不適
    #    dp[i] += [a]
    #    dp[i] += [b]
        #これはうまくいく
        #やり方はいろいろあるということ
    #print(dp)


    #brray=[list(map(int, input().split(" ")))for i in range(N)
    #print(brray)



    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]#内包表記に慣れろ
    #print(pin_l)

    ls = ["a", "b", "c", "d", "e"]


    #print(ls[2:5])
    #スライスでの取得

    #print(ls[:-3])
    #一番左端から右から3番目より左まで取得

    #print(ls[:4:2])
    #スライスで1個飛ばしで取得
    #ないときは左端スタート
    #始点のインデックス番号 : 終点のインデックス番号 : スキップする数+1
    #print(ls[::2])
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
s=input()
alpha=[chr(i) for i in range(ord("A"),ord("Z")+1)]
encode=alpha[n:]+alpha[:n]
text=[]
for c in s:
    text.append(encode[alpha.index(c)])
    print("".join)

Submission status: Wrong Answer

Solution code:
n=int(input())
s=input()
ans=''
for ss in s:
  if ord(ss)+n<=ord('z'):
    ss=chr(ord(ss)+n)
  else:
    ss=chr(ord(ss)+n-26)
  ans+=ss
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

S = ''.join([chr(ord(s)+N) for s in S])
print(S)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
s = input()
a = s[n:]
b = s[:n]
print(a+b)

Submission status: Wrong Answer

Solution code:
n=int(input())
s=list(input())
alf=("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 k in range(len(alf)):
    if s[i]==alf[k] and k<=23:
      s[i]==alf[k+2]
    elif s[i]==alf[24]:
      s[i]=="A"
    elif s[i]==alf[25]:
      s[i]=="B"
      
print(''.join(s))

Submission status: Wrong Answer

Solution code:
import string
N=int(input())
S=list(str(input()))

Alphabet_List=list(string.ascii_uppercase)
Alphabet_List.extend(2*Alphabet_List)

for i in range(len(S)):
    for j in range(len(Alphabet_List)):
        if S[i]==Alphabet_List[j]:
            S[i]=Alphabet_List[j+13]
            break
            
print(("").join(S))

Submission status: Wrong Answer

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

print(s[n:] + s[:n])

Submission status: Wrong Answer

Solution code:
KEY = int(input())
PLAIN = input()


enc = ""

for char in list(PLAIN):
    ASCII = ord(char)
    num = ASCII - 97
    num = (num + KEY) % 26
    ASCII = num + 97
    enc += chr(ASCII)

print(enc)

Submission status: Wrong Answer

Solution code:
n= int(input())
s = input()
a =''
for i in range(len(s)):
   
    a += (chr(ord(s[i])+n))
     
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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