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

Solution in C# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            String S = Console.ReadLine();

            String S_new = "";
            foreach (char s in S) {
                int n_new_num = (CharToNum(s) + N) % 26;
                char n_new = NumToChar(n_new_num);
                S_new += n_new;
            }

            Console.WriteLine(S_new);

        }

        static public int CharToNum(char c) {
            if (c == 'A') {
                return 0;
            } else if (c == 'B') {
                return 1;
            } else if (c == 'C') {
                return 2;
            } else if (c == 'D') {
                return 3;
            } else if (c == 'E') {
                return 4;
            } else if (c == 'F') {
                return 5;
            } else if (c == 'G') {
                return 6;
            } else if (c == 'H') {
                return 7;
            } else if (c == 'I') {
                return 8;
            } else if (c == 'J') {
                return 9;
            } else if (c == 'K') {
                return 10;
            } else if (c == 'L') {
                return 11;
            } else if (c == 'M') {
                return 12;
            } else if (c == 'N') {
                return 13;
            } else if (c == 'O') {
                return 14;
            } else if (c == 'P') {
                return 15;
            } else if (c == 'Q') {
                return 16;
            } else if (c == 'R') {
                return 17;
            } else if (c == 'S') {
                return 18;
            } else if (c == 'T') {
                return 19;
            } else if (c == 'U') {
                return 20;
            } else if (c == 'V') {
                return 21;
            } else if (c == 'W') {
                return 22;
            } else if (c == 'X') {
                return 23;
            } else if (c == 'Y') {
                return 24;
            } else if (c == 'Z') {
                return 25;
            } else {
                return 0;
            }
        }

        static public char NumToChar(int n)
        {
            if (n == 0) {
                return 'A';
            } else if (n == 1) {
                return 'B';
            } else if (n == 2) {
                return 'C';
            } else if (n == 3) {
                return 'D';
            } else if (n == 4) {
                return 'E';
            } else if (n == 5) {
                return 'F';
            } else if (n == 6) {
                return 'G';
            } else if (n == 7) {
                return 'H';
            } else if (n == 8) {
                return 'I';
            } else if (n == 9) {
                return 'J';
            } else if (n == 10) {
                return 'K';
            } else if (n == 11) {
                return 'L';
            } else if (n == 12) {
                return 'M';
            } else if (n == 13) {
                return 'N';
            } else if (n == 14) {
                return 'O';
            } else if (n == 15) {
                return 'P';
            } else if (n == 16) {
                return 'Q';
            } else if (n == 17) {
                return 'R';
            } else if (n == 18) {
                return 'S';
            } else if (n == 19) {
                return 'T';
            } else if (n == 20) {
                return 'U';
            } else if (n == 21) {
                return 'V';
            } else if (n == 22) {
                return 'W';
            } else if (n == 23) {
                return 'X';
            } else if (n == 24) {
                return 'Y';
            } else if (n == 25) {
                return 'Z';
            } else {
                return 'a';
            }
        }
    }
}