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++14 (GCC 5.4.1) (judge verdict: Accepted)

#include<bits/stdc++.h>
#include<set>
#include<queue>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
using namespace std;
typedef long long ll;

#define pb push_back
#define PI acos(-1.0)
#define MAX 10000007 //1e7+7
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define __FastIO  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
struct P
{
  ll pos,val;
};


int main(){
  ll N,M,A,B,C,D,testCase,K,val;
  ll arr[1005],brr[100005];
  map<ll,ll>mp;
  vector<ll>v,v1;
  vector< pair<ll,ll> >Pair;
  string str;
  while(cin>>N)
  {
    cin>>str;
    for(int i=0;i<str.size();i++)
    {
      /*if(str[i]>='a' and str[i]<='z')
        {
          ll tmp1=int(str[i])-97;
        }
        */
      ll tmp=int(str[i])+N,Num=N;
      if(str[i]>='a' and str[i]<='z' and tmp<=122)
      {
        str[i]=str[i]+N;
      }
      else if(str[i]>='A'  and str[i]<='Z' and tmp<=90)
      {
        str[i]=str[i]+N;
      }
      else
      {
        if(str[i]>='a' and str[i]<='z')
        {
          val=int(str[i]);
          while(N>0)
          {
            if((val+1)<=122)
            {
              val++;
            }
            else
            {
              val=97;
            }
            N--;
          }
          str[i]=char(val);
        }
        else
        {
          val=int(str[i]);
          while(N>0)
          {
            if((val+1)<=90)
            {
              val++;
            }
            else
            {
              val=65;
            }
            N--;
          }
          str[i]=char(val);
          N=Num;
        }
      }
    }
    cout<<str<<endl;
  }
  return 0;
}