B - ROT N Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 200200

問題文

英大文字のみからなる文字列 SS があります。また、整数 NN が与えられます。

SS の各文字を、アルファベット順で NN 個後の文字に置き換えた文字列を出力してください。

ただしアルファベット順で Z11 個後の文字は A とみなします。

制約

  • 0N260 \leq N \leq 26
  • 1S1041 \leq |S| \leq 10^4
  • SS は英大文字のみからなる

入力

入力は以下の形式で標準入力から与えられる。

NN
SS

出力

SS の各文字を、アルファベット順で NN 個後の文字に置き換えた文字列を出力せよ。


入力例 1Copy

Copy
2
ABCXYZ

出力例 1Copy

Copy
CDEZAB

アルファベット順で Z11 個後の文字は A であることに注意してください。


入力例 2Copy

Copy
0
ABCXYZ

出力例 2Copy

Copy
ABCXYZ

入力例 3Copy

Copy
13
ABCDEFGHIJKLMNOPQRSTUVWXYZ

出力例 3Copy

Copy
NOPQRSTUVWXYZABCDEFGHIJKLM

Score : 200200 points

Problem Statement

We have a string SS consisting of uppercase English letters. Additionally, an integer NN will be given.

Shift each character of SS by NN in alphabetical order (see below), and print the resulting string.

We assume that A follows Z. For example, shifting A by 22 results in C (A \to B \to C), and shifting Y by 33 results in B (Y \to Z \to A \to B).

Constraints

  • 0N260 \leq N \leq 26
  • 1S1041 \leq |S| \leq 10^4
  • SS consists of uppercase English letters.

Input

Input is given from Standard Input in the following format:

NN
SS

Output

Print the string resulting from shifting each character of SS by NN in alphabetical order.


Sample Input 1Copy

Copy
2
ABCXYZ

Sample Output 1Copy

Copy
CDEZAB

Note that A follows Z.


Sample Input 2Copy

Copy
0
ABCXYZ

Sample Output 2Copy

Copy
ABCXYZ

Sample Input 3Copy

Copy
13
ABCDEFGHIJKLMNOPQRSTUVWXYZ

Sample Output 3Copy

Copy
NOPQRSTUVWXYZABCDEFGHIJKLM


2025-04-11 (Fri)
06:12:23 +00:00