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 JavaScript (node.js v5.12) (judge verdict: Wrong Answer)

var GET = (function () {
    function f(s) {
        return new g(s);
    }

    function g(s) {
        this._s = s.trim().split("\n");
    }

    g.prototype.getValue = function (n) {
        return this.stox(this._s[n]);
    };
    g.prototype.getArray = function (n) {
        return this.stoa(this._s[n]);
    };
    g.prototype.slice = function (s, limit) {
        return this._s.slice(s, +limit + s || undefined).map(v => this.stox(v));
    };
    g.prototype.sliceArray = function (s, limit) {
        return this._s.slice(s, +limit + s || undefined).map(v => this.stoa(v));
    };
    g.prototype.stoa = function (s) {
        return s.split(" ").map(v => this.stox(v));
    };
    g.prototype.stox = function (v) {
        var i = +v;
        return (i === i) ? i : v;
    };
    return f;
})();
var o = GET(require("fs").readFileSync("/dev/stdin", "utf8"));

console.log(main());
function main(){
    var N = o.getValue(0);
    var S = o.getValue(1);

    var 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"
    ];

    var ans = "";
    for(var i = 0; S.length > i; i++) {
        var index = alphabet.findIndex((v) => S[i] === v);
        console.log(N + index);
        ans += alphabet[(N + index) % 26]
    }

    return ans;
}