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: Runtime Error

Solution code:
def change_str(moto_str):
    global Nnew
    global str_list
    global change_list

    for i in range(len(change_list)):
       if change_list[i] == moto_str:
            num = i+Nnew
            if num > 25:
                num = num - 25
    return change_list[num]

Nnew = int(input())
str = input()
str_list = list(str)
change_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"]

for i in range(len(str_list)):
    str_list[i] = change_str(str_list[i])


print(*str_list,sep='')

Submission status: Runtime Error

Solution code:
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
m = int(input())
list = str(input())
n = len(list)
for i in range(n):
	if int(alpha.index(list[i])) + m < 26:
		list[i] = alpha[int(alpha.index(list[i])) + m]
	else:
		list[i] = alpha[int(alpha.index(list[i])) + m -26] 
print(list)

Submission status: Runtime Error

Solution code:
a = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
b = ''
e = int(input())

for c in list(input()):
  d = a.index(c)
  if d > 23:
    d = d - (23 + e + 1)
  b += a[(d+e)]

print(b)

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
a=list(S)
alpha=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A"]
SS2=[]
for i in range(len(a)):
    x=alpha.index(a[i])
    SS2.append(x)
 
for j in range(len(SS2)):
    SS2[j]+=N
 
SS3=[]
for k in range(len(SS2)):
    y=alpha[SS2[k]]
    SS3.append(y)
 
moji="".join(SS3)
print(moji)

Submission status: Runtime Error

Solution code:
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
m = int(input())
list = str(input())
n = len(list)
for i in range(n):
	if alpha.index(list[i]) + m < 26:
		list[i] = alpha[alpha.index(list[i]) + m]
	else:
		list[i] = alpha[alpha.index(list[i]) + m -26] 
print(list)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
alpha = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
i = 0
while i < len(s):
  j = 0
  while j < 26:
    if s[i] == alpha[j]:
      s[i] = alpha[i+n]
      break
    else:j += 1
  i += 1

k = 0
while k < len(s) :
  print(s[k],end ="")
  k += 1

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
alphabet = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]*2

ans = [0]*n
for i in range(s):
    S = s[i]
    key = alphabet.index(S)
    ans[i] = alphabet[key+n]
print("".join(ans))

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
a=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
b=[["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"],
   ["B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A"],
   ["C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B"],
   ["D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C"],
   ["E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D"],
   ["F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E"],
   ["G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F"],
   ["H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G"],
   ["I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H"],
   ["J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I"],
   ["K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J"],
   ["L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K"],
   ["M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L"],
   ["N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M"],
   ["O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N"],
   ["P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O"],
   ["Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P"],
   ["R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q"],
   ["S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R"],
   ["T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S"],
   ["U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T"],
   ["V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U"],
   ["W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V"],
   ["X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W"],
   ["Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X"],
   ["Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y"],
  ]
c=[]
for i in  range(len(s)):
    cnt=a.index(s[i])
    c.append(str(b[cnt][n]))
for i in range(len(s)):
  print(c[i],end="")

Submission status: Runtime Error

Solution code:
# 数字
N = map(int, input().split()

# 文字
S = input()

AAA = ""

for char in list(S):
    hoge = ord(char)
    huga = hoge - 97
    huga = (huga + S) % 26
    hoge = num + 97
    AAA += chr(hoge)

print()

Submission status: Runtime Error

Solution code:
a = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
b = ''

for c in list(input()):
  d = a.index(c)
  if d > 23:
    d = d - 26
  b += a[d+2]

print(b)

Submission status: Runtime Error

Solution code:
in = [input() for i in range(2)]
num = str(in[0])
strCodePoint = ord(in[1])
sum = num + strCodePoint
if sum > 65 + 26 :
  print(char(sum - 26))
else:
  print(char(sum))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

moji_list = []
for i in range(N):
  if (ord(S[i])+N) <= 90:
    moji_list.append(chr(ord(S[i]) + N))
  else:
    moji_list.append(chr(ord(S[i]) + N - 26))
    
  
print("".join(moji_list))

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
dic={"A":1,"B":2,"C":3,"D":4,"E":5,"F":6,"G":7,"H":8,"I":9,"J":10,"K":11,"L":12,"M":13,"N":14,"O":15,"P":16,"Q":17,"R":18,"S":19,"T":20,"U":21,"V":22,"W":23,"X":24,"Y":25,"Z":26}
di={1:"A",2:"B",3:"C",4:"D",5:"E",6:"F",7:"G",8:"H",9:"I",10:"J",11:"K",12:"L",13:"M",14:"N",15:"O",16:"P",17:"Q",18:"R",19:"S",20:"T",21:"U",22:"V",23:"W",24:"X",25:"Y",26:"Z"}
li=[]
t=len(s)
for i in range(0,t):
  k=s[i]
  m=dic[k]
  a=(m+n)%26
  b=di[a]
  li.append(b)
print("".join(li))

Submission status: Runtime Error

Solution code:
num = int(input())
al = input()

newal = ""
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(len(al)):
  if(alp.index(al[i])+num>25):
    newal = newal + alp[(alp.index(al[i])+num)-25]
  else:
    newal = newal + alp[alp.index(al[i])+num]
  
print(newal)

Submission status: Runtime Error

Solution code:
Num=input()
String=int(input())
Library=[['A',1],['B',2],['C',3],['D',4],['E',5],['F',6],['G',7],['H',8],['I',9],['J',10],['K',11],['L',12],['M',13],['N',14],['O',15],['P',16],['Q',17],['R',18],['S',19],['T',20],['U',21],['V',22],['W',23],['X',24],['Y',25],['Z',26]]
newstring=''
for i in String:
    for j in range(0,25):
        if i==Library[j][0]:
            oldstring=newstring
            newstring=oldstring+Library[(j+Num)%26][0]
print(newstring)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
sorted(s)
print((s-s[n:])+s[n:])

Submission status: Runtime Error

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

lst = [chr(ord('a') + i) for i in range(26)]
lst_up = list(map(str.upper,lst))
for i in range(len(S)):
    if int(lst_up.index(S[i])+N) <= len(lst_up):
        S[i] = lst_up[lst_up.index(S[i])+N]
    elif  int(lst_up.index(S[i])+N) > len(lst_up):
        S[i] = lst_up[lst_up.index(S[i])+N-26]

lst_2 = "".join(S)
print(lst_2)

Submission status: Runtime Error

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

moji_list = []
for i in range(N):
  moji_list.append(chr(ord(S[i]) + N))
  
print("".join(moji_list))

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
s=sorted(s)
print(s[n:]+(s-s[n:]))

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
sorted(s)
print(s[n:]+(s-s[n:]))

Submission status: Runtime Error

Solution code:
a=int(input())
s=input()
d=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
S=list(s)
for i in range(len(S)):
  z=S.index(S[i])
  S[i]=d[z+a]
print("".join(S))

Submission status: Runtime Error

Solution code:
N = input()
S = input()
t = []
for i in S:
    t.append(chr(ord(i) + N))
print(t.join)

Submission status: Runtime Error

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']
nalp = []
n = int(input())
str = input()
chars = list(str)

for i in range(len(chars)):
  num = alp.index(chars[i])
  if n+num>26:
      num -= 26
  nalp.append(alp[n+num])

mojiretu = ' '
 
for x in nalp:
    mojiretu += x
print(mojiretu)

Submission status: Runtime Error

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

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

ans=""

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

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input().sort()
print(s[n:]+(s-s[n:]))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
l = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(0,len(s)):
  for j in range (0,26):
    if s[i] == l[j]:
      s[i] = l[(j+n)%26]
      break
print(s)

Submission status: Runtime Error

Solution code:
def myinput():
    n = input()
    s = input()
    return n, s

def rot(n, s):
    z = ord('Z')
    chars = []

    for c in s:
        code = ord(c) + n
        if code > z:
            code -= 26
        chars.append(chr(code))
    return ''.join(chars)

def main():
    n, s = myinput()
    ret = rot(n, s)
    print(ret)

main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
t = ''
abc = [chr(i) for i in range(65, 65+26)]
for i in s:
  m = abc.index(i)
  if m+n <= 25:
    t += abc[m+n]
  else:
    t += abc[m+n-25]
print(t)

Submission status: Runtime Error

Solution code:
def judge(S,N):
    a = [x for x in list(S)]
    lst = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B"]
    mak = []
    llst = lst
    for i in range(len(a)):
        for j in range(25):
            if a[i]==lst[j]:
                mak.append(lst[j+N])
    print("".join(mak))

N = int(input())
S = input()
judge(S,N)

Submission status: Runtime Error

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


def get_key(d, value):
    for k, v in d.items():
        if v == value:
            return k


output = []
a_dict = {1: 'A', 2: 'B', 3: 'C', 4: 'D', 5: 'E', 6: 'F', 7: 'G', 8: 'H', 9: 'I', 10: 'J', 11: 'K', 12: 'L', 13: 'M',
          14: 'N', 15: 'O', 16: 'P', 17: 'Q', 18: 'R', 19: 'S', 20: 'T', 21: 'U', 22: 'V', 23: 'W', 24: 'X', 25: 'Y',
          26: 'Z'}
for i, a in enumerate(a_list):
    n = get_key(a_dict, a)
    n += s
    if n > 26:
        n %= 26
    output.append(a_dict.get(n))
answer = ''.join(output)

print(answer)

Submission status: Runtime Error

Solution code:
N=int(input())
S=list(input())
A=''
for i in S:
    if ord(i)+N<ord('Z'):
        A+=chr(ord(i)+N)
    else:
        A+=chr(ord(i)+N-ord('z'))
print(A)

Submission status: Runtime Error

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

res = list()

strings = [chr(ord('a').upper() + i) for i in range(26)]
for s in S:
  ind = strings.index(s) + N
  res.append(strings[ind % len(strings)])
  
print(''.join(map(str, res)))

Submission status: Runtime Error

Solution code:
a=int(input())
s=input()
list= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
slist = [*s]
ans = str()
for si in slist:
    i = list.find(si)
    ans += list[(i+a)%26]
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input().sort()
print(s[:n]+s[n:])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for i in range(len(s)):
  for j in range(len(a)):
    if s[i] == a[j]:
      if j+n < len(a):
        x = j+n
      	s[i] = a[x]
      else:
        x = j+n-len(a)
        s[i] = a[x]
print(s)

Submission status: Runtime Error

Solution code:
AL = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

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

A = ''

for i in range(len(S)):
  B = AL.index(S[i]) + N
  A += AL[B]

print(A)

Submission status: Runtime Error

Solution code:
input_n = 0
input_string = ""

while True:

  input_n = int(input())
  input_string = input()

  if( 0 <= input_n <= 26):
    break
      
for n in range(len(input_string)):
  if(int(input_string[n]) + input_n > 90):
    print("%s"%(int(input_string[n]) + input_n - 65),end="")
  else:
    print("%s"%(int(input_string[n]) + input_n),end="")

Submission status: Runtime Error

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

a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for i in range(len(s)):
  for j in range(len(a)):
    if s[i] == a[j]:
      if j+n < len(a):
      	s[i] = a[j+n]
      else:
        s[i] = a[j+n-len(a)]
print(s)

Submission status: Runtime Error

Solution code:

def b():
    delta = int(input())
    day: str = input()

    ret = ""
    for chrd in list(day):
        ret += chr(ord("A") + ((ord(chrd) - ord("A") + delta) % 26))

    print(ret)



if __name__ == "__main__":
    b()

Submission status: Runtime Error

Solution code:
num = int(input())
al = input()

newal = ""
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(len(al)):
  newal = newal + alp[i+num]
  
print(newal)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
lst=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','X','Y','Z']
S=list(s)
for i in range(len(s)):
  idx=lst.index(S[i])
  S[i]=lst[(idx+n)%len(lst)]
t=''.join(S)
print(t)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for a in s:
    s1.append(alph[alph.index(a) + n])

print("".join(s1))

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
st=""
n2=0
for i in range(N):
  c1=S[i]
  n1=ord(c1)
  if n1+N>26:
    n2=(((n1-65)+N)%26)+65
  else:
    n2=n1
  st=st+chr(n2)
print(st)

Submission status: Runtime Error

Solution code:
N=int(input())
S=list(input())
for i in S:
  S[i]=chr(ord(i)+N)
print(S)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<numeric>
#include<cctype>
#include<random>

//#include<boost/circular_buffer.hpp>
using namespace std;

//cout << fixed << setprecision(10);
typedef long long ll;
#define PI 3.141592653589793
#define Yes(a) a ? "Yes" : "No";
#define YES(a) a ? "YES" : "NO";
#define rep(i,n) for(int i=0;i<n;i++)

int gcd(int a, int b) {
	if (a < b) {
		int tmp = a;
		a = b;
		b = tmp;
	}
	int r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}

int lcm(int a, int b) {
	long long int L;
	L = (a * b) / gcd(a, b);
	return L;
}

vector<long long  int> Prime;
void Eratosthenes(long long int n) {
	vector<bool> is_prime(n, true);
	for (int i = 2; i * i <= n; i++) {
		;
		if (is_prime.at(i)) {
			for (int j = i * i; j <= n; j += i) {
				is_prime.at(j) = false;
			}
		}
		Prime.emplace_back(i);
	}
}

/*
map<int, int> prime;
void Prime_number(long long int n) {
	for (int i = 2; i <= n; i++) {
		int count = 0;
		while (n % i == 0) {
			count++;
			n /= i;
		}
		if (count != 0) {
			prime.insert(make_pair(i, count));
		}
	}
}
*/
//std::cout.fill('0');

int main() {
	int n;
	string s;
	string str[7] = { "SUN","MON","TUE","WED","THU","FRI","SAT" };
	

	cin >> n >> s;
	int N = s.size();
	for (int i = 0; i < N; i++) {
		s[i] = (s[i] - 'A' + n) % 26 + 'A';
	}
	cout << s << endl;
}

Submission status: Runtime Error

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

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

ans=""

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

print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF = 1e11;
int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    rep(i,s.length()){
        if (s[i] - 'A' + n >= 26){
            s[i] = s[i] + n - 26;
        }
        else{
            s[i] = s[i] + n;
        }
    }
    PRINT(s);
}

Submission status: Runtime Error

Solution code:

def b():
    delta = int(input())
    day: str = input()

    ret = ""
    for chrd in list(day):
        ret += chr(ord(chrd) + delta)

    print(ret)



if __name__ == "__main__":
    b()

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
lst=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','X','Y','Z']
S=list(s)
for i in range(n):
  idx=lst.index(S[i])
  S[i]=lst[(idx+n)%len(lst)]
t=''.join(S)
print(t)

Submission status: Runtime Error

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


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


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


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


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


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


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


# C
def C():
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Unittest
def resolve():
    B()
    return


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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
S=input().split()
for i in S:
    S[i]=chr(ord(i)+N)
print(S)

Submission status: Runtime Error

Solution code:
def main(n: int, s: str):
    ans = ""
    for _s in s:
        ans += ascii[(ascii.index(_s) + n) % 26]

    print(ans)


if __name__ == "__main__":
    n = int(input())
    s = input()

    main(n, s)

Submission status: Runtime Error

Solution code:

#include <bits/stdc++.h>

using namespace std;

#define rep(i, x)   for (__typeof(x) i = 0; i < x; i++)
#define mp             make_pair
#define pb             push_back
#define fi             first
#define se             second
#define sz(x)          (int)((x).size())
#define all(x)         (x).begin(), (x).end()
#define sci(x)         int x;       scanf("%d", &x);
#define scii(x, y)     int x, y;    scanf("%d %d", &x, &y);
#define sciii(x, y, z) int x, y, z; scanf("%d %d %d", &x, &y, &z);
#define TC(x)          sci(x); while(x --)
#define eprintf(...)   fprintf(stderr, __VA_ARGS__)
#define debug(x)       { cerr << #x << " = " << x << endl; }
#define repi(i, x)  for (__typeof(x) i = x-1; i >= 0; i --)
#define fore(itr, x)   for (__typeof(x.begin()) itr = x.begin(); itr != x.end(); itr ++)
#define forei(itr, x)  for (__typeof(x.end()) itr = x.end() - 1; itr != x.begin() - 1; itr --)
typedef long long      ll;
typedef pair<int, int> ii;
typedef pair<ii, int>  iii;
typedef vector<int>    vi;
typedef vector<ii>     vii;
typedef vector<iii>    viii;
typedef vector<vector<int> > vvi;
typedef pair<ll, ll>   pairl;
typedef vector<ll>     vl;
typedef vector<ll>     vll;
typedef vector<vector<ll> > vvl;
const   int            infi = numeric_limits<int>::max();
const   ll             infl = numeric_limits<ll>::max();
const   double         eps = 0;
const   int            ms  = 0;



int main()
{
    ios::sync_with_stdio(false);//endl->"\n"
    cin.tie(0);
    int N;
    string s;
    cin >> N;
    cin >> s;
    string a = "";
    for(int i = 0; i < s.size(); i++){
        char c = s[i];
        c = (c + N - 'A')%('Z' - 'A'+1)+'A';
        a+=c;
    }
    cout << a << endl;
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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