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:
#abc146b

n=int(raw_input())
s=raw_input()
t=''
for c in range(len(s)):
 x=ord(s[c])-ord('A')
 x=(x+n)%26
 t+=chr(ord('A')+x)
print t

Submission status: Accepted

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

s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

res = []

for i in S:
    index = s.index(i)
    s_index = index+N if index + N < 25 else index + N - 26
    res.append(s[s_index])

print(''.join(res))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
L = len(S)
S = list(S)
for i in range(L):
    for j in range(N):
        if S[i] != 'Z':
            S[i] = chr(ord(S[i])+1)
        else:
            S[i] = 'A'
print("".join(S))

Submission status: Accepted

Solution code:
ls=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
N=26-int(input())
S=input()
ans=[]
for i in range(len(S)):
  x=ls.index(S[i])
  ans.append(ls[x-N])
print("".join(ans))

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
for i in range(len(s)):
    for j in range(65, 91):
        if s[i] == chr(j):
            if j + n >= 91:
                s[i] = chr(65 + n - (91 - j))
                break
            else:
                s[i] = chr(j + n)
                break
print(''.join(s))

Submission status: Accepted

Solution code:
class Cycle:
    def __init__(self, list, n):
        self.i = 0
        self.list = list
        self.n = n

    def next(self):
        self.i = (self.i + 1) % len(self.list)
        return self.list[self.i]

    def previous(self):
        self.i = (self.i - 1 + len(self.list)) % len(self.list)
        return self.list[self.i]

    def present(self):
        return self.list[self.i]

    def reset(self):
        self.i = 0
        return

    def get_ans(self, c):
        self.reset()
        while True:
            if c == self.list[self.i]:
                break
            else:
                self.next()
        cnt = self.n
        while cnt != 0:
            self.next()
            cnt -= 1
        return self.list[self.i]


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

cycle = Cycle(['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)

for c in S:
    print(cycle.get_ans(c), end="")

Submission status: Accepted

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

alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
dic = {a:i for i,a in enumerate(alpha)}


ans = ''
for s in S:
    idx = dic[s]+N 
    if dic[s]+N > 25: idx -= 26
    ans += alpha[idx]
print(ans)

Submission status: Accepted

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

ans = ""
for s in S:
    if s.islower():
        alph = string.ascii_lowercase
    else:
        alph = string.ascii_uppercase
    ans += alph[(alph.find(s) + N) % 26]
print(ans)

Submission status: Accepted

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

alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans =""

for i in s:
    #print(alp.index(i)+1+n)
    if alp.index(i)+1+n > 26:
        ans += alp[alp.index(i)+n-26]
    else:
        ans += alp[alp.index(i)+n]

print(ans)

Submission status: Accepted

Solution code:
list = [chr(ord('A') + i) for i in range(26)]

N = int(raw_input())
S = map(str,raw_input())
for i in range(0,len(S)):
  for j in range(0,26): 
    if S[i] == list[j]:
      if j+N >= 26:
        S[i] = list[j+N-26]
        break
      else:
        S[i] = list[j+N]
        break
print(''.join(S))

Submission status: Accepted

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

Submission status: Accepted

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

#output
def a_s_translator(s):
    n = ord(s)
    n += N
    if 65 <= n <= 90:
        t = chr(n)
    else:
        n -= 26
        t = chr(n)
    return t

T = []
for i in range(len(S)):
    T.append(a_s_translator(S[i]))

print(*T, sep = "")

Submission status: Accepted

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

for s in S:
    tmp = ord(s)
    tmp += n
    if tmp > 90:
        tmp -= 26
    print(chr(tmp), end='')

Submission status: Accepted

Solution code:
# B - ROT N
N = int(input())
S = str(input())
for s in S:
    tmp = ord(s) + N
    if tmp > 90:
        tmp -= 26
    print(chr(tmp), end="")

Submission status: Accepted

Solution code:
def A():
    s = input()
    days = ['SAT', 'FRI', 'THU', 'WED', 'TUE','MON', 'SUN']
    print(days.index(s)+1)

def B():
    d = {chr(65+i): i for i in range(0, 26)}
    N = int(input())
    S = input()
    ans = ""
    def helper(n):
        if n>25:
            return n-26
        return n
    for c in S:
        ans+=chr(65+helper(N+d[c]))
    print(ans)
B()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = list(input().encode())
Acode = "A".encode()[0]
for i in range(len(s)):
  s[i] = (s[i] + n - Acode) % 26 + Acode 

print(bytearray(s).decode())

Submission status: Accepted

Solution code:
arphs = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
n = int(input())
s = list(input())
i = []
for x in s:
  i.append(arphs[arphs.index(x) + n])
print("".join(i))

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
a = []
cs = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
for c in S:
    a.append(cs[cs.index(c) + (N%26)])
print("".join(a))

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

r = ''.join(chr((ord(c) - ord('A') + n) % 26 + ord('A')) for c in s)
print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string
n = int(input())
s = input()
for c in s:
  print(string.ascii_uppercase[(ord(c)-ord('A')+n)%26], end='')
print()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
s = input()
for i in s:
  k = l.index(i)+n
  print(l[k%26], end="")
print("")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
alf = ([chr(i) for i in range(ord("A"), ord("Z") + 1)])
N = int(input())
s = str(input())
S = list(s)
ans = []
for i in S:
    num1 = alf.index(i)
    num2 = num1 + N
    if num2<= 25:
        ans.append(alf[num2])
    else:
        ans.append(alf[num2-26])
Ans = "".join(ans)
print(Ans)

Submission status: Accepted

Solution code:
# B問題
# pythonの文字列は作成後に変更できないことに注意。リストに変えて、また戻す必要がある。
N = int(input())
S = input()
S_list = list(S)

# Asciiコードが関わる
for i in range(len(S_list)):
    x = (ord(S_list[i]) - ord('A') + N)%26 +ord('A')
    S_list[i] = chr(x)

ans = ''.join(S_list)
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
s = input()
ans = ''
for x in s:
    ans += alphabet[(ord(x) - ord('A') + n) % 26]
print(ans)

Submission status: Accepted

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

    ans = ''
    for word in S:
        tmp = ord(word) # 文字列 → ASCIIコード
        tmp += N
        if tmp > 90: tmp -= 26
        ans += chr(tmp) # ASCIIコード → 文字列

    print('{}'.format(ans))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = ''
for word in S:
    tmp = ord(word) # 文字列 → ASCIIコード
    tmp += N
    if tmp > 90: tmp -= 26
    ans += chr(tmp) # ASCIIコード → 文字列

print('{}'.format(ans))

Submission status: Accepted

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

N = input()
S = input()

hoge1 = list(S)
hoge2 = [int(alpha2num(s)) + int(N) for s in hoge1]
hoge3 = [t - 26 if t > 26 else t for t in hoge2]
hoge4 = [num2alpha(t) for t in hoge3]

print(''.join(hoge4))

Submission status: Accepted

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

for  s in S:
    if ord(s) + N <= 90:
        O += chr((ord(s)+N))
    else:
        O += chr(64 + (ord(s) + N) - 90)

print(O)

Submission status: Accepted

Solution code:
# 2019-11-24 20:59:47(JST)
import sys
from string import ascii_uppercase as alphabet

# alpha_num = dict((alpha, num) for num, alpha in enumerate(alphabet, 0))
alpha_ind = dict((alphabet[i], i) for i in range(26))

def main():
    n, s = sys.stdin.read().split()
    n = int(n)

    t = ''
    for char in s:
        t += alphabet[(alpha_ind[char] + n) % 26]
    
    print(t)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    def f(c, n):
        chars = [chr(i) for i in range(ord('A'), ord('Z')+1)]
        p = (chars.index(c) + n) % 26
        return chars[p]

    N = int(input())
    S = input()
    ans = ''
    for si in S:
        ans += f(si, N)
    print(ans)

    
  

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# 2019-11-24 20:59:47(JST)
import sys
from string import ascii_uppercase as alphabet

alpha_num = dict((alpha, num) for num, alpha in enumerate(alphabet, 0))

def main():
    n, s = sys.stdin.read().split()
    n = int(n)

    t = ''
    for char in s:
        t += alphabet[(alpha_num[char] + n) % 26]
    
    print(t)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
conv = []
rev = 0

for s in S:
  conv.append(chr((ord(s) - ord('A') + N) % 26 + ord('A')))

ans = "".join(conv)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

a = []

for i in range(len(s)):
  b =  ord(s[i])
  b -= 65
  b += n
  b = b % 26
  b += 65
  b = chr(b)
  a.append(b)

  
a= ''.join(a)
  
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,s=open(0)
for c in s[:-1]:print(chr(65+(ord(c)-65+int(n))%26),end='')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = ""
for s in S:
	diff = N
	if ord(s)+N > 90:
		diff = N-26
	ans = ans + chr(ord(s)+diff)
print(ans)

Submission status: Accepted

Solution code:
from string import ascii_uppercase
n=int(input())
S=input()
d1,d2=dict(),dict()
for i,A in enumerate(ascii_uppercase):
    d1[i]=A
    d2[A]=i
ans=''
for s in S:
    ans+=d1[(d2[s]+n)%26]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
ans = []
abc = [chr(i) for i in range(65,65+26)]
for i in range(len(s)):
    tmp = abc.index(s[i])
    
    if int((tmp+n)) >= int(len(abc)):
        ans.append(abc[(tmp+n) - len(abc)])
    else:
        ans.append(abc[tmp+n])

anser = "".join(ans)
print(anser)

Submission status: Accepted

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

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

Submission status: Accepted

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

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

print(S.translate(str.maketrans(alphabet, alphabet[N:] + alphabet[:N])))

Submission status: Accepted

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

for i in range(len(S)):
  k = ord(S[i]) - ord('A')
  l = (k + N) % 26
  print(chr(l + ord('A')), end="")

Submission status: Accepted

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

Submission status: Accepted

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:
        if n % 26 == 0:
            n = 26
        else:
            n %= 26
    output.append(a_dict.get(n))
answer = ''.join(output)

print(answer)

Submission status: Accepted

Solution code:
#%%
n = int(input())
s = list(input())
num2alpha = lambda c: chr(c+65)
alpha2num = lambda c: num2alpha((ord(c) - ord('A')+ n)%26)

for i in range(len(s)):
    s[i] = alpha2num(s[i])
print(''.join(s))

Submission status: Accepted

Solution code:
#%%
n = int(input())
s = list(input())
num2alpha = lambda c: chr(c+65)
alpha2num = lambda c: num2alpha((ord(c) - ord('A')+ n)%26)

for i in range(len(s)):
    s[i] = alpha2num(s[i])
print(''.join(s))

#%%







# %%

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())
t=""
for i in s:
    if ord(i)+n<=90:
        t+=chr(ord(i) + n)
    else:
        t+=chr(ord(i) + n -26)
print(t)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alps = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
number = 0
ans = str()

for i in range(len(s)):
  alp = s[i]
  for j in range(26):
    if alps[j] == alp:
      number = (j + n) % 26
      ans += alps[number]
      
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
for i in s:
    k = ord(i)+n
    print(chr(k-(k>ord("Z"))*26),end= "")

Submission status: Accepted

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

Submission status: Accepted

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

new = ""
for i in range( len( S ) ):
    _num = ord( S[i] ) + N
    if _num >=91:
        num = _num - 26
    else:
        num = _num
    alphabet = chr( num )
    new += alphabet 
print( new )

Submission status: Accepted

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

A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for i,s in enumerate(S):
    n = A.index(s)
    if n+N > 25:
        nn = n+N-26
    else:
        nn = n+N
    S[i]=A[nn]

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

Submission status: Accepted

Solution code:
n=int(input())
z=input()
s=list(z)
n=n%26
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"]
x=int(len(s))
d=[]
for i in range(x):
    b=s.pop(0)
    y=a.index(b)
    if y+n>25:
        c=y+n-26
    else:
        c=y+n
    d.append(a[c])
v=int(0)
ans=''.join(d)   
print(ans)

Submission status: Accepted

Solution code:
int_N = int(input())
str_S = input()

str_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"]

ans = ""

for i in range(len(str_S)):
	cur = (str_list.index(str_S[i]) + int_N ) % 26
	ans += str_list[ cur ]

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
S=input()
for c in S:
  k=ord(c)+N
  print(chr(k-(k>ord("Z"))*26),end="")

Submission status: Accepted

Solution code:
N=int(input())
S=input()
for c in S:
  k=ord(c)+N
  print(chr((k,k-26)[k>ord("Z")]),end="")

Submission status: Accepted

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

ans_ls = []
for x in str:
    i = ord(x) + num
    if i <= 90:
        ans_ls.append(i)
    else:
        ans_ls.append(i - 26)
ls = []
for y in ans_ls:
    l = chr(y)
    ls.append(l)

ans = ''.join(ls)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
alphabet_large = {chr(i):i for i in range(65, 65+26)} #大文字
S = input()
ans = ""
for x in S:
    y = alphabet_large[x]+n
    if y >= 65+26:
        y -= 26
    ans += chr(y)

print(ans)

Submission status: Accepted

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

#print N, S

res = ['0' for i in range(len(S))]

#print res

for i in range(len(S)):
    res[i] = ord(S[i])+N
    if res[i] > ord('Z'):
        res[i] -= 26
    res[i] = chr(res[i])

#print res
result = ""
for i in range(len(S)):
    result += res[i]
print result

Submission status: Accepted

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

ans = []
for s in S:
    a = ord(s) - base
    ans.append(chr((a + N) % 26 + base))
print(''.join(ans))

Submission status: Accepted

Solution code:
num = int(input())
target = 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"]
output = []        
for i in range(len(target)):
    tmp = alphabet.index(target[i])
    tmp = tmp + num
    while tmp >= 26:
        tmp = tmp - 26        
    output.append(alphabet[tmp])
print("".join(output))

Submission status: Accepted

Solution code:
n=int(input().rstrip())
s=input().rstrip()
t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

le=len(s)
ans=""
for i in range(0,le):
    u=0;
    for j in range(0,26):
        if(t[j]==s[i]):
            u=j
    ans+=t[(u+n)%26]
print(ans)

Submission status: Accepted

Solution code:
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']
n = int(input())
s = input()
s_list = list(s)
rot=[]
for i in range(len(s_list)):
    for j in range(26):
        if alpha[j] == s_list[i]:
            pos = (j+n) % 26
            rot.append(alpha[pos])
print(''.join(rot))

Submission status: Accepted

Solution code:
import sys

#+++++

def rot_n(c, n):
	ci=ord(c)-ord('A')
	nci = (ci + n )%26
	nci+=ord('A')
	ret = chr(nci)
	return ret

def main():
	n = int(input())
	s = input()
	
	c=['A']*len(s)
	for i in range(len(s)):
		c[i]=rot_n(s[i], n)
	
	print(''.join(c))
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
x=int(input())
s=input().strip()
ans=""
for i in s:
	xx=(ord(i)-ord('A'))+x 
	xx=xx%26
	cc=chr(ord('A')+xx)
	ans+=cc
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
i2s = {i:s for i, s in zip(range(26), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")}
s2i = {s:i for i, s in zip(range(26), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")}
ans = ""
for s in S:
    ans = ans + i2s[(s2i[s]+N)%26]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ans = [''] * len(s)

for i in range(len(s)):
  rot = ord(s[i]) + n
  if rot > ord('Z'):
    rot -= (ord('Z') - ord('A') + 1)
    
  ans[i] = chr(rot)
  
print(''.join(ans))

Submission status: Accepted

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

for i in S:
  d=ord(i)
  d+=N
  if d>90:
    d-=26
  i=chr(d)
  print(i,end="")

Submission status: Accepted

Solution code:
n=int(input())
s=input()
leng=len(s)
slist=[]
#print(slist)
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", "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(alphabet)
for i in range(0,leng):
    for j in range(0,26):
#        print(s[i])
#        print(alphabet[j])
        if s[i]==alphabet[j]:
            #print(j)
            slist.append(alphabet[j+n])
            #print(alphabet[j+n])
            #print(slist[i])

print(''.join(slist))

Submission status: Accepted

Solution code:
N = int(input())

s = input()

alpha = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ' * 3)

ans = ''
for ss in s:
  index = alpha.index(ss)
  ans += alpha[index + N]
  
print(ans)

Submission status: Accepted

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

ans = ""

for i in s :
    if ord('A') <= ord(i) <= ord('Z') :
        ans = ans + chr(abs(((ord(i) + n - ord('A')) % 26)) + ord('A'))

print (ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ns = []
for ch in s:
    if ('A' <= ch and ch <= 'Z'):
        ns.append(chr((ord(ch) - ord('A') + n) % 26 + ord('A')))
       
   
print("".join(ns))

Submission status: Accepted

Solution code:
def main():
  
    ss = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    ss_rev = dict()
    for i in range(len(ss)):
      ss_rev[ss[i]] = i
 
    N = input()
    N = int(N)
    S = input()
    ans = ""
    for i in range(len(S)):
      ans += ss[(ss_rev[S[i]]+N)%26]
    print(ans)
    
 
if __name__ == '__main__':
  main()

Submission status: Accepted

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


def encrypt(S, N):
    X = ""

    for ch in list(S):
        if 'A' <= ch <= 'Z':
            X += chr((ord(ch) - ord('A') + int(N)) % 26 + ord('A'))
        elif 'a' <= ch <= 'z':
            X += chr((ord(ch) - ord('a') + int(N)) % 26 + ord('a'))
        else:
            X += ch

    return X

# 暗号化
X = encrypt(S, N)
print(X)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)

N = int(input())
S = input()
rot = []
for i in S:
  if ord(i) + N  >= 91:
    a = chr(ord(i) + N - 26) 
  else:
    a =chr(ord(i) + N)
  rot.append(a)
  
print(''.join(rot))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = input()
    c = [(ord(i) + N - ord("A")) % 26 + ord("A") for i in S]
    # print(c)
    print("".join([chr(i) for i in c]))
main()

Submission status: Accepted

Solution code:
def f(N,S):
    alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    ret_s = ""
    for s in S:
        num = (alpha.index(str(s)) + int(N))
        if num <= 25:
            pass
        else:
            num = num-(num//26)*26
        ret_s += alpha[num]
    return print(ret_s)
  
a = input()#13#
b = input()#"ABCDEFGHIJKLMNOPQRSTUVWXYZ"#
 
f(a,b)

Submission status: Accepted

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

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

for item in S:
    if item + N > 90:
        s.append(chr(item + N - 26))
    else:
        s.append(chr(item + N))

out = "".join(s)

print(out)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
AA = []
for i in range(len(S)):
    AA.append(S[i])

def change1(s):
    if s == 'A':
        return 1
    elif s == 'B':
        return 2
    elif s == 'C':
        return 3
    elif s == 'D':
        return 4
    elif s == 'E':
        return 5
    elif s == 'F':
        return 6
    elif s == 'G':
        return 7
    elif s == 'H':
        return 8
    elif s == 'I':
        return 9
    elif s == 'J':
        return 10
    elif s == 'K':
        return 11
    elif s == 'L':
        return 12
    elif s == 'M':
        return 13
    elif s == 'N':
        return 14
    elif s == 'O':
        return 15
    elif s == 'P':
        return 16
    elif s == 'Q':
        return 17
    elif s == 'R':
        return 18
    elif s == 'S':
        return 19
    elif s == 'T':
        return 20
    elif s == 'U':
        return 21
    elif s == 'V':
        return 22
    elif s == 'W':
        return 23
    elif s == 'X':
        return 24
    elif s == 'Y':
        return 25
    elif s == 'Z':
        return 26

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

for i in range(len(S)):
    AA[i] += N
    if AA[i] > 26:
        AA[i] -= 26
        
def change2(S):
    if S == 1:
        return 'A'
    elif S == 2:
        return 'B'
    elif S == 3:
        return 'C'
    elif S == 4:
        return 'D'
    elif S == 5:
        return 'E'
    elif S == 6:
        return 'F'
    elif S == 7:
        return 'G'
    elif S == 8:
        return 'H'
    elif S == 9:
        return 'I'
    elif S == 10:
        return 'J'
    elif S == 11:
        return 'K'
    elif S == 12:
        return 'L'
    elif S == 13:
        return 'M'
    elif S == 14:
        return 'N'
    elif S == 15:
        return 'O'
    elif S == 16:
        return 'P'
    elif S == 17:
        return 'Q'
    elif S == 18:
        return 'R'
    elif S == 19:
        return 'S'
    elif S == 20:
        return 'T'
    elif S == 21:
        return 'U'
    elif S == 22:
        return 'V'
    elif S == 23:
        return 'W'
    elif S == 24:
        return 'X'
    elif S == 25:
        return 'Y'
    elif S == 26:
        return 'Z'


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

BB = "".join(AA)
print(BB)

Submission status: Accepted

Solution code:
# B - ROT N
n = (int)(input())
s = list(input())

def translate(s, n):
    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']

    for i in range(0, 26):
        if alphabet[i] == s:
            return alphabet[(i + n) % 26]



for c in s:
    print(translate(c, n), end="")

Submission status: Accepted

Solution code:
N=int(input())
S=input()
ans = ""
for ch in S:
    if ("a" <= ch and ch <= "z"):
        ans += chr((ord(ch) - ord('a') + N) % 26 + ord('a'))
    elif ("A" <= ch and ch <= "Z"):
        ans += chr((ord(ch) - ord('A') + N) % 26 + ord('A'))
    elif ('0' <= ch and ch <= '9'):
        ans += chr((ord(ch) - ord('0') - N) % 10 + ord('0'))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
S=list(input())
ans = ""
for s in S:
    ASCII = ord(s)
    n = ASCII - 65
    n = (n + N) % 26
    ASCII = n + 65
    ans += chr(ASCII)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ss = input()
s = []
for i in ss:
    s.append(i)
res = ""
n = n % 26
#print(n)
for i in s:
    #print(i)
    if ord(i)+n > 90:
        res+=chr(ord(i)-26+n)
    else:
        res += chr(ord(i)+n)
    #print(res)
        
print(res)

Submission status: Accepted

Solution code:
import re


def main():
    N = int(input())
    S = input()
    a = ""
    Ans = ""

    for s in S:
        a = ord(s)+N
        if a > 90:
            a = a-26
        Ans += chr(a)

    print(Ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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']
ans = ''

for c in s:
    if alp.index(c) + n > 25:
        ans += alp[alp.index(c)+n-26]
    else:
        ans += alp[alp.index(c) + n]

print(ans)

Submission status: Accepted

Solution code:
def caesar(s, n):
    d = {}
    for c in (65, 97):
        for i in range(26):
            d[chr(i+c)] = chr((i+n) % 26 + c)

    return "".join([d.get(c, c) for c in s])

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

print(caesar(s, n))

Submission status: Accepted

Solution code:
import sys,queue,copy,math
sys.setrecursionlimit(10**8)
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
INF = float('inf')
N = int(input())
S = list(input())
x = ""
ans =list()
for x in S:
    if ord(x)+N > ord('Z'):
        ans.append(ord('A') + (ord(x) + N - (ord('Z')))-1)
    else:
        ans.append(ord(x) + N)

ANS = list()
for i in range(len(S)):
    ANS.append(chr(ans[i]))

print("".join(ANS))

Submission status: Accepted

Solution code:
x = int(input())
y = input()
z = ""
s = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
for i in y:
    num = s.index(i)
    z += (s[(num + x) % 26])
print(z)

Submission status: Accepted

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

for i in range(len(S)):
    
    n = Alpha.index(S[i])


    S[i] = Alpha[(n + N)%26]

print(*S,sep="")

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
s = list(map(lambda x : ord(x)+n, s))
for i in range(len(s)):
    if s[i] >= 91:
        s[i] = s[i] - 26
    else:
        pass
s = list(map(lambda x : chr(x), s))
t = ''.join(s)
print(t)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = ''
alpha2num = lambda c: ord(c) - ord('A') + 1
num2alpha = lambda c: chr(c+64)
for i in range(0,len(S)):
    y = alpha2num(S[i]) + N
    if y > 26:
        y -= 26
    ans += num2alpha(y)
print(ans)

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
#import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**6)
input=lambda: sys.stdin.readline().rstrip()

show_flg=False
show_flg=True

n=I()
s=input()
uu=u_alp*2
dict1=dict(zip(u_alp,range(0,26)))
#show(dict1)
a=[]
for i in s:
    a+=[uu[n+uu.index(i)]]
print(''.join(a))