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=list(input())

alpha=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") # idx : 0-25
for i in range(len(S)):
    idx = alpha.index(S[i])
    idx_re = idx + N
    if idx_re > 25:
        idx_re = idx_re %25 -1
    else:
        idx_re=idx_re%26
    S[i] = alpha[idx_re]

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

Submission status: Wrong Answer

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

alpha=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") # idx : 0-25
for i in range(len(S)):
    idx = alpha.index(S[i])
    idx_re = idx + N
    if idx_re > 25:
        idx_re = idx_re %25 -1
    else:
        idx_re=idx_re%26
    S[i] = alpha[idx_re]


print(*S)

Submission status: Wrong Answer

Solution code:

n = int(input())
s = input()
ans=[]
a = "ABCDEFGHIJKLMNOPQRSTUWVXYZabcdefghijklmnopqrstuwvxyz"
a_list=[]
for j in a:
	a_list.append(j)
for i in range (len(s)):
	ans.append(a_list[a_list.index(s[i])+n].upper())
print("".join(ans))

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

n = ni()
s = input()
ans = ""
for i in range(len(s)):
    ans += num2alpha(((alpha2num(s[i]) + n) % 26))
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = ""
for i in range(len(s)):
  num = ord(s[i])
  num = num + (KEY % 26)
  if ord("Z") < num:
    num = ord("A") + num - ord("Z")
  ans += chr(num)
print(ans)

Submission status: Wrong Answer

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

alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in S:

    s=ord(i)
    if 65 <= s and s <= 90:
        s = s + 3
    elif 97 <= s and s <= 122:
        s = s + 3
    i=chr(s)
    letters+=i
print(letters)

Submission status: Wrong Answer

Solution code:
def q2(in_num, in_str):
    o_str = ""
    letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    for i in range(len(in_str)):
        o_str += (letters[(letters.index(in_str[i])+int(in_num))%26])
    return o_str

q2(input(),input())

Submission status: Wrong Answer

Solution code:
import string
List = [chr(i) for i in range(65,65+26)]
N = int(input())
s = list(input())
for i in range(len(s)):
  if s[i] == 'Z':
    s[i] = 'A'
    continue
  s[i] = List[List.index(s[i])+1]
print(*s)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=input()
b=""   
for i in range (len(a)):
  if((ord(a[i])+n)>=92):
    b=b+str(65+ord(a[i])+n-91);
  else:    
    b+=str(ord(a[i])+n);
print(b)

Submission status: Wrong Answer

Solution code:
import string

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

lis = list(string.ascii_uppercase)
answer = []

for s in S:
    index = lis.index(s)
    slide_index = index + N
    if slide_index > 25:
        slide_index -= 26
    new_s = lis[slide_index]
    answer.append(new_s)
answer = list(answer)

print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] == li[j+N]
print("".join(sli))

Submission status: Wrong Answer

Solution code:
S = input()
N = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] == li[j+N]
      break
print("".join(sli))

Submission status: Wrong Answer

Solution code:
S = input()
N = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] == li[j+N]
print("".join(sli))

Submission status: Wrong Answer

Solution code:
S = input()
N = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] == li[j+2]
print("".join(sli))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = input()
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
s = [i for i in S]


for i in range(len(S)):
  index = alp.index(S[i])
  ans_index = (index + N + 1) % 26
  s[i] = alp[ans_index]

ans = ""
for i in s:
  ans += i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import string

alphabet = string.ascii_uppercase + string.ascii_uppercase

n_steps = int(input())
row_text = input()
processed_tuple = (alphabet[alphabet.index(x)+n_steps] for x in row_text)
print(*processed_tuple)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


# A:65
# Z:90

Submission status: Wrong Answer

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

alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
di = {}
for i in range(len(alp)):
    di[alp[i]] = i
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = N % len(S)

ans = []
for s in S:
    ans.append(alp[di[s]+N])

print(''.join(ans))

Submission status: Wrong Answer

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

N = N % len(S)

ans = []
for i in range(N, len(S)):
    ans.append(S[i])

for i in range(N):
    ans.append(S[i])

print(''.join(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ans = ''
for i in range(len(s)):
    ans += s[i]

print(ans)

Submission status: Wrong Answer

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[i]))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
s = input()
fin = ''
for i in range(len(s)):
  t = ord(s[i])-ord('A')+n 
  if (t > 25):
    fin += chr(ord(s[i])+t-26)
  else:
    fin +=chr(ord(s[i])+t)
print(fin)

Submission status: Wrong Answer

Solution code:
alpha2int = lambda x: ord(x) - ord("A") + 1
def int2alpha(x):
    if  x != 26:
        x = x % 26 
    return chr(x + 64)

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

out_s = ""
for i in range(len(S)):
    out_s += int2alpha(alpha2int(S[i]) + N)
    
print(out_s)

Submission status: Wrong Answer

Solution code:
s = input()

N = int(s)

s = input()

S = s

for c in S:
    t = ord(c)
    t = t - 65 # A
    t = t + N
    t = t % 24
    print(chr(t+65))

Submission status: Wrong Answer

Solution code:
s = input()

N = int(s)

s = input()

S = s

for c in S:
    t = ord(c) + N
    if t > 90:
       t = t-24
    print(chr(t))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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(len(S)):
    for j in range(len(abc)):
        if S[i] == abc[j]:
            if j + N < 26:
                ans.append(abc[j + N])
            else:
                ans.append(abc[j + N -26])


print("".join(ans).upper())

Submission status: Wrong Answer

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(len(S)):
    for j in range(len(abc)):
        if S[i] == abc[j]:
            if j + N < 26:
                ans.append(abc[j + N])
            else:
                ans.append(abc[j + N -26])


print("".join(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = str(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(len(S)):
    for j in range(len(abc)):
        if S[i] == abc[j]:
            ans.append(abc[j + N])


print("".join(ans))

Submission status: Wrong Answer

Solution code:
def main():
   n = input()
   data = list(input())
   for i in data:
      a = ord(i) + int(n)
      if a > ord("Z"):
         a = a + ord("A") - ord("Z")
      print(chr(a),end = "")
   print("")

if __name__==  "__main__":
   main()

Submission status: Wrong Answer

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

stdata = [chr(s) for s in range(ord("A"),ord("Z") + 1)]
ans = []
for i in range(len(s)):
  ind = stdata.index(s[i])
  ind = (ind + n) % 26
  ans.append(stdata[ind])
for i in range(len(s)):
  print(ans[i],end=" ")

Submission status: Wrong Answer

Solution code:
N = int(input())
S = input()
string = ''
alpha = lambda c: ord(c) - ord('A') - 1
num = lambda c: chr(c+97+N)
for i in S:
  s = alpha(i) % 26
  string += num(s)
print(string)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = input()
string = ''
alpha = lambda c: ord(c) - ord('A') - 1
num = lambda c: chr(c+96)
for i in S:
  s = alpha(i) % 26
  string += num(s)
print(string)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = input()
string = ''
alpha = lambda c: ord(c) - ord('A') - 3
num = lambda c: chr(c+96)
for i in S:
  s = alpha(i) % 26
  string += num(s)
print(string)

Submission status: Wrong Answer

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

for c in s:
  result += chr((((ord(c) + n) -64) % 26) + 64)
  
print(result)

Submission status: Wrong Answer

Solution code:
# ABC146B - ROT N
def main():
    N = int(input())
    S = input().rstrip()
    ans = "".join([chr(64 + (ord(ch) + N - 64) % 26) for ch in S])
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:

def main(N, S):
    base = ord('A')
    res = ''.join(chr((ord(s) - base + N) % 26 + base) for s in S)
    print(res)


if __name__ == "__main__":
    N = int(input('N >'))
    S = input('S >')
    main(N, S)

Submission status: Wrong Answer

Solution code:
N = int(input())

str = list(input())

out = []

for st in str:
    num = ord(st) + N
    if num >= 91:
        num = num - 26
    out.append(chr(num))

print(out)

Submission status: Wrong Answer

Solution code:
import string
l=string.ascii_uppercase
N=int(input())
S=input()
T=""
for i in range(len(S)):
  for j in range(26):
    if S[i]==l[j]:
      T+=l[(i+N)%26]
      break
print(T)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(len(S)):
    tmp = ord(S[i])+2
    if(tmp>90):
        tmp -= 26
    print(chr(tmp),end='')

print('')

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
S = input()
alp = "ABCDEFGHIJKLMNOPQRSTUWVXYZABCDEFGHIJKLMNOPQRSTUWVXYZ"
for s in S:
    sys.stdout.write(alp[ord(s) - 65 + N])

Submission status: Wrong Answer

Solution code:
n = int(input())
ary = list(input())
alf = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

sort = []
for s in ary:
    next_index = alf.index(s) + n
    if next_index > 25:
        next_index = (next_index - 1) % 25

    sort.append(alf[next_index])


print("".join(sort))

Submission status: Wrong Answer

Solution code:
n = int(input())
ary = list(input())
alf = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

sort = []
for s in ary:
    next_index = alf.index(s) + n
    if next_index > 25:
        next_index - 1
    index = next_index % 25
    sort.append(alf[index])


print("".join(sort))

Submission status: Wrong Answer

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

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for c in s:
	ans += alphabet[alphabet.index(c) % 26]
    
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = input()
alph_list = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
for i in s:
    pos =alph_list.find(i)
    print(alph_list[n+pos],end="")

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

res = ''

for i, j in enumerate(strings):
    res += strings[(i+number) % len(strings)]

print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = input()
P = []
for i in range(len(S)):
    if ord(S[i]) + N > 90:
        temp = (ord(S[i]) + N) - 90
        P.append(chr(65 + (temp - 1)))
    else:
        P.append(chr(ord(S[i]) + N))
print(P)

Submission status: Wrong Answer

Solution code:
al=[]
al=[chr(i) for i in range(65, 65+26)]

n=int(input())
s=input()
ans=""
i=0
next=0

while i < len(s):
	j=0
	while j < len(s):
		if s[i] == al[j]:
			next=0
			next=j+n
			if next > 25:
				next-=26
			ans = ans + al[next]
			break
		j += 1
	i+=1

print(ans)

Submission status: Wrong Answer

Solution code:
# input() は 'python3' で正常に動く
N = int(input())
S = input()
 
str_list = list(S)
str_trsf = []
 
for item in str_list:
    str_trsf.extend(chr(N - (ord('Z') - ord(item)) + ord('A')) if ord(item) + N > ord('Z') else chr(ord(item) + N))

print(''.join(str_trsf))

Submission status: Wrong Answer

Solution code:
# input() は 'python3' で正常に動く
N = int(input())
S = input()

str_list = list(S)
str_trsf = []

for item in str_list:
    str_trsf.extend(chr(ord('A') + ord('Z') - ord(item)) if ord(item) + N > ord('Z') else chr(ord(item) + N))

print(''.join(str_trsf))

Submission status: Wrong Answer

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

for i in range(len(s)):
  result = result + chr(ord(s[i]) + n)

print(result)

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

string = list(map(lambda x:ord(x)+n,string))

print(ord("A"))
for e in string:
    if e <= 90:
        print(chr(e),end="")
    else:
        print(chr(e-26),end="")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s = list(S)
s_new =[]
for i in range(len(S)):
    s[i] = chr(ord(s[i])+N)
    s_new.append(s[i])
print(''.join(s_new))

Submission status: Wrong Answer

Solution code:
N=int(input()) % 25
L=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']
NUM=range(0,len(ALP))
ALP_NO = dict(zip(ALP,NUM))
PLUS_ALP=ALP[N:] + ALP[:N]
ANS=''
for s in L:
  NUM = ALP_NO[s]
  ANS += PLUS_ALP[NUM]
print(ANS)

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

new_s = s[n:] + s[:(-1)*(n)]

print(new_s[:len(s)])

Submission status: Wrong Answer

Solution code:
dict = ['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']
new_str = ''
S = int(input())
strs = input()

for x in strs:
  new_idx = (dict.index(x)+S)%26
  new_str += str(new_idx)
  
print(new_str)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    N = int(input())
    S = input()
    al=[chr(ord('A') + i) for i in range(26)]
    ans = ''
    for s in S:
        ans += al[(N+S.index(s))%26]
    print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = input()
int_A = 65
letters = 25
nums = [ord(char) for char in S]
nums = [(num - int_A + N) % letters for num in nums ]
print(''.join([chr(num + int_A) for num in nums]))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = input()
int_A = 65
letters = 25
nums = [ord(char) for char in S]
print(nums)
nums = [(num - int_A + N) % letters for num in nums ]
print(nums)
print(''.join([chr(num + int_A) for num in nums]))

Submission status: Wrong Answer

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

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(0, len(s)):
	b = s[i]
	x = abc.index(b) + n
	print(x)
	while x > 25:
		x = x - 26	
	y = abc[x]
	print(y)
	s = list(s)
	s[i] = y
	s = ''.join(s)
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = input()
k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
  s = s.replace(s[i], k[(k.index(s[i])+n)%len(k)])
print(s)

Submission status: Wrong Answer

Solution code:
base_str, num = 'TEST', 24
alphabets = ['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']
def replacer(letter, num):
    letter_index = alphabets.index(letter)
    return(alphabets[(letter_index+num)%27])
answer = []
for i in range(len(base_str)):
    answer.append(replacer(base_str[i], num))
answer = ''.join(answer)
print(answer)

Submission status: Wrong Answer

Solution code:
def shiftText(plain_text, key):
    plain_text.lower
    encoded_text = ""
    for i in plain_text:
        char = ord(i)+key
        if (char > 122):
            char -= 26
            encoded_text += chr(char)
        else:
            encoded_text += chr(char)
    return encoded_text


key = int(input())
plain_text = input()

print(shiftText(plain_text, key))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = list(input())
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']

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

Submission status: Wrong Answer

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

for i in S:
    l.append(i)

l = [ord(i) for i in l]     #ascii
newl = []
for i in l:
    if i <= 89:
        i -= 24
    else:
        i += 2
    newl.append(i)

newl = [chr(i) for i in newl]
newl = ''.join(newl)
print(newl)

Submission status: Wrong Answer

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

for i in S:
    l.append(i)

l = [ord(i) for i in l]     #ascii
newl = []
for i in l:
    if i <= 89:
        i -= 24
    else:
        i += 2
    newl.append(i)

newl = [chr(i) for i in newl]
newl = ''.join(newl)

Submission status: Wrong Answer

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

zn = ord('Z')
ret = ''
for x in s:
  a = ord(x) + 2
  if a > zn:
    a -= zn
    a += ord('A')-1
  ret += chr(a)

print(ret)

Submission status: Wrong Answer

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

zn = ord('Z')
ret = ''
for x in s:
  a = ord(x) + 2
  if a > zn:
    a -= zn
    a += ord('A')-1
  ret += chr(a)

print(ret)

Submission status: Wrong Answer

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

zn = ord('Z')
ret = ''
for x in s:
  a = ord(x) + 2
  if a > zn:
    a -= zn
    a += ord('A')
  ret += chr(a)

print(ret)

Submission status: Wrong Answer

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

s = list(s)

l1 = 'abcdefghijklmnopqrstuvwxyz'
l1 = list(l1)

#print(s)

l2 = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
l2 = list(l2)

s1 = [0]*len(s)
s2 = [0]*len(s)

#for i in range(len(s)):
#	s1[i] = l1.index(s[i])

print(s)    
    
#for i in range(len(s)):
#	s2[i] = l2[s1[i]+n] 

#print(s)    
    
#リスト１つずつくっつけて文字列にする
#ans = ''
#for i in range(len(s2)):
#	ans = ans + s2[i]

#print(ans)

Submission status: Wrong Answer

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

s = list(s)

l1 = 'abcdefghijklmnopqrstuvwxyz'
l1 = list(l1)

print(s)

#l2 = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
#l2 = list(l2)

#s1 = [0]*len(s)
#s2 = [0]*len(s)

#for i in range(len(s)):
#	s1[i] = l1.index(s[i])

#for i in range(len(s)):
#	s2[i] = l2[s1[i]+n] 

#リスト１つずつくっつけて文字列にする
#ans = ''
#for i in range(len(s2)):
#	ans = ans + s2[i]

#print(ans)

Submission status: Wrong Answer

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

s = list(s)

print(s)

#l1 = 'abcdefghijklmnopqrstuvwxyz'
#l1 = list(l1)

#l2 = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
#l2 = list(l2)

#s1 = [0]*len(s)
#s2 = [0]*len(s)

#for i in range(len(s)):
#	s1[i] = l1.index(s[i])

#for i in range(len(s)):
#	s2[i] = l2[s1[i]+n] 

#リスト１つずつくっつけて文字列にする
#ans = ''
#for i in range(len(s2)):
#	ans = ans + s2[i]

#print(ans)

Submission status: Wrong Answer

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

print(s)

#s = list(s)

#l1 = 'abcdefghijklmnopqrstuvwxyz'
#l1 = list(l1)

#l2 = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
#l2 = list(l2)

#s1 = [0]*len(s)
#s2 = [0]*len(s)

#for i in range(len(s)):
#	s1[i] = l1.index(s[i])

#for i in range(len(s)):
#	s2[i] = l2[s1[i]+n] 

#リスト１つずつくっつけて文字列にする
#ans = ''
#for i in range(len(s2)):
#	ans = ans + s2[i]

#print(ans)

Submission status: Wrong Answer

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

ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUWVXYZ'
ALPHABET_LEN = len(ALPHABET)
prceed_val = n % ALPHABET_LEN

def trans(s):
    pos = ALPHABET.index(s)
#     print(s)
#     print(pos)
    newpos = pos + prceed_val


    if newpos > ALPHABET_LEN - 1:
        newpos = abs(ALPHABET_LEN - newpos)
#         print(minus_pos)
#         newpos = newpos + minus_pos

#     print(newpos)
    new_s = ALPHABET[newpos]
    return new_s

new_str= ''.join([trans(_s) for _s in s])

print(new_str)

Submission status: Wrong Answer

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

n = 2
s = 'ABCXYZ'

ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUWVXYZ'
ALPHABET_LEN = len(ALPHABET)
prceed_val = n % ALPHABET_LEN

def trans(s):
    pos = ALPHABET.index(s)
#     print(s)
#     print(pos)
    newpos = pos + prceed_val


    if newpos > ALPHABET_LEN - 1:
        newpos = abs(ALPHABET_LEN - newpos)
#         print(minus_pos)
#         newpos = newpos + minus_pos

#     print(newpos)
    new_s = ALPHABET[newpos]
    return new_s

new_str= ''.join([trans(_s) for _s in s])

print(new_str)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc146/tasks/abc146_b
A = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

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

A_LIST = list(A)

result = []

for i in range(len(S)):
    for wi in range(len(A_LIST)):
        # S[i] 文字は wi番目のアルファベット
        if S[i] == A_LIST[wi]:
            ss = (N + wi) % 26
            result.append(A_LIST[ss])

print(result)

Submission status: Wrong Answer

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

alphabet = ["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"]

output = []

for chara in S:
    print(chara)
    a = alphabet.index(chara)
    print(a)
    b = alphabet[(a + N) % 26]
    output.append(b)

print(''.join(output))

Submission status: Wrong Answer

Solution code:
N=input()
S=input()
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"]
out=[]
for i in S:
  ind=abc.index(i)
  ind+=2
  if ind>25:
    ind-=26
  out.append(abc[ind])
out1=''.join(out)
print(out1)

Submission status: Wrong Answer

Solution code:
_,l=int(input()),input();print("".join(l[_:]+l[:_]))

Submission status: Wrong Answer

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

A = ord('A')

T = [chr(A + (ord(c) - A + N) % 26) for c in S]

print(T)

Submission status: Wrong Answer

Solution code:
N=input()
s=input()
#ABCXYZ
print(N)
print(s)
L=[]
L.append('A')
L.append('B')
L.append('C')
L.append('D')
L.append('E')
L.append('F')
L.append('G')
L.append('H')
L.append('I')
L.append('J')
L.append('K')
L.append('L')
L.append('M')
L.append('N')
L.append('O')
L.append('P')
L.append('Q')
L.append('R')
L.append('S')
L.append('T')
L.append('U')
L.append('V')
L.append('W')
L.append('X')
L.append('Y')
L.append('Z')

answer=[]
for l in s:
  num=L.index(l)
  #print(type(num))
  #print(type(int(N)))
  newN=L.index(l)+int(N)
  n=newN%26
  answer.extend(L[n])  
  
answer="".join(answer)
print(answer)

Submission status: Wrong Answer

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

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

result = ''

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

Submission status: Wrong Answer

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

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())
inp_string = input()
result = ""
for char in inp_string:
  value = ord(char)
  value += n
  print(char,value)
  if value > 90:
    value = 64 + (value - 90)
  print(value,chr(value))
  result += chr(value)
print(result)

Submission status: Wrong Answer

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

for s in S:
    i = A.index(s) + N 
    if i >= 26:
        i -= 26
    x = A[i]
    print(x)

Submission status: Wrong Answer

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) % 25
  return str[index]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 -= 25
    S_list[i] = chr(M)

print("".join(S_list))

Submission status: Wrong Answer

Solution code:
alp_list = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S_list = list(input())
Slen = len(S_list)
S_return_list = []
print(Slen)
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: Wrong Answer

Solution code:
def rotn(s,n):
    result = []
    for i in s:
        if ("a" <= i <= "m") or ("A" <= i <= "M"):
            result.append(chr(ord(i) + n))
        elif ("n" <= i <= "z") or ("N" <= i <= "Z"):
            result.append(chr(ord(i) - n))
        else:
            result.append(i)
    return "".join(result)

i = int(input())
s = input() 

sa = rotn(s,i)
print(sa)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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-1]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))

Submission status: Wrong Answer

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

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

Solution code:
n = int(input())
s = list(input())
s.sort()
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: Wrong Answer

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

for i in list(S):
    num = ord(i)+N
    if num >= 65 or num <= 90:
        Answer_list.append(chr(num))
    elif num < 90:
        Answer_list.append(chr(num - 26))
print(''.join(Answer_list))

Submission status: Wrong Answer

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

for i in list(S):
    Answer_list.append(chr(ord(i)+N))
print(''.join(Answer_list))