stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int h,w,n;

int ab[3]={0,1,-1};

ll ans[12];

vector < pair<ll,ll> > x;

map < pair<ll,ll>,int > y;

map < pair<ll,ll>,bool > z;

int main()

{

	cin>>h>>w>>n;

	ans[0]=1ll*(h-2)*(w-2);

	while(n--)

    {

        int a,b;

        cin>>a>>b;

        for(int i=0;i<3;i++)

            for(int j=0;j<3;j++)

                if(a+ab[i]>1&&a+ab[i]<h&&b+ab[j]>1&&b+ab[j]<w)

                {

                    x.push_back(pair<ll,ll>(a+ab[i],b+ab[j]));

                    y[pair<ll,ll>(a+ab[i],b+ab[j])]++;

                }

    }

    for(int i=0;i<x.size();i++)

        if(!z[pair<ll,ll>(x[i].first,x[i].second)])

        {

            ll a=x[i].first,b=x[i].second;

            ans[y[pair<ll,ll>(a,b)]]++;

            z[pair<ll,ll>(a,b)]=1;

            ans[0]--;

        }

    for(int i=0;i<10;i++)

        printf("%lld\n",ans[i]);

}


// Faster C++ solution for the same problem (measured speedup: 5.110118575635217x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

    scanf("%d%d%d",&H,&W,&N);

    int x,y;

    int xx,yy;

    int count=0;

    for(int i=0;i<N;i++)

    {

       scanf("%d%d",&x,&y);

       for(int i=-1;i<=1;i++)

       {

           for(int j=-1;j<=1;j++)

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

    memset(ans,0,sizeof(ans));

    for(int i=0;i<count;i++)

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

    printf("%lld\n",z);

    for(int i=1;i<10;i++)

        printf("%lld\n",ans[i]);

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<map>

using namespace std;

const int N=20;

typedef long long ll;

map<pair<int,int>,int>sum;

ll ans[N];

int n,m;

void Paint(int x,int y){

    for(int i=-1;i<=1;i++)

        for(int j=-1;j<=1;j++){

            int a=x+i,b=y+j;

            if(a<=1||b<=1||a>=n||b>=m)

                continue ;

            int p=sum[make_pair(a,b)];

            sum[make_pair(a,b)]++;

            ans[p]--;

            ans[p+1]++;

        }

}

int main()

{

    int k;

    scanf("%d%d%d",&n,&m,&k);

    ans[0]=1ll*(n-2)*(m-2);

    for(int i=1;i<=k;i++){

        int u,v;

        scanf("%d%d",&u,&v);

        Paint(u,v);

    }

    for(int i=0;i<=9;i++)

        printf("%lld\n",ans[i]);

}


// Faster C++ solution for the same problem (measured speedup: 4.671091883131026x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

    scanf("%d%d%d",&H,&W,&N);

    int x,y;

    int xx,yy;

    int count=0;

    for(int i=0;i<N;i++)

    {

       scanf("%d%d",&x,&y);

       for(int i=-1;i<=1;i++)

       {

           for(int j=-1;j<=1;j++)

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

    memset(ans,0,sizeof(ans));

    for(int i=0;i<count;i++)

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

    printf("%lld\n",z);

    for(int i=1;i<10;i++)

        printf("%lld\n",ans[i]);

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<map>

#include<algorithm>

using namespace std;

long long ans[16],way[9][2]={{0,0},{1,0},{-1,0},{0,1},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}},H,W,a,b;

int n;

map<long long,int> ma;

int main()

{

	scanf("%lld%lld%d",&H,&W,&n);

	ans[0]=(H-2)*(W-2);

	for(int i=1;i<=n;i++)

	{

		scanf("%lld%lld",&a,&b);

		for(int j=0;j<9;j++)

		{

			long long nea=a+way[j][0];

			long long neb=b+way[j][1];

			if(nea>=H||neb>=W||nea<2||neb<2) continue;

			ans[ma[nea*W+neb]]--;

			ans[++ma[nea*W+neb]]++;

		}

	}

	for(int i=0;i<10;i++)

		printf("%lld\n",ans[i]);

}

// Faster C++ solution for the same problem (measured speedup: 4.625723188278102x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

    scanf("%d%d%d",&H,&W,&N);

    int x,y;

    int xx,yy;

    int count=0;

    for(int i=0;i<N;i++)

    {

       scanf("%d%d",&x,&y);

       for(int i=-1;i<=1;i++)

       {

           for(int j=-1;j<=1;j++)

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

    memset(ans,0,sizeof(ans));

    for(int i=0;i<count;i++)

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

    printf("%lld\n",z);

    for(int i=1;i<10;i++)

        printf("%lld\n",ans[i]);

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<map>

#include<algorithm>

using namespace std;

#define LL long long

typedef pair<int,int> PII;

map<PII,int>Q;

int ans[10],cnt;

int main()

{

	int n,m,k,u,v;

	scanf("%d%d%d",&n,&m,&k);

	for(int i=0;i<k;i++)

	{

		scanf("%d%d",&u,&v);

		for(int i=-2;i<=0;i++)

		{

			if(i+u<=0) continue;

			if(i+u>=n-1) break;

			for(int j=-2;j<=0;j++)

			{

				if(v+j<=0) continue;

				if(v+j>=m-1) break;

				Q[PII(i+u,j+v)]++;

			}

		}

	}

	for(map<PII,int>::iterator it=Q.begin();it!=Q.end();it++)

	{

		ans[it->second]++;

		cnt++;

	}

	LL tot=1LL*(n-2)*(m-2)-cnt;

	printf("%lld\n",tot);

	for(int i=1;i<=9;i++)

		printf("%d\n",ans[i]);

}

// Faster C++ solution for the same problem (measured speedup: 4.655166307625744x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

    scanf("%d%d%d",&H,&W,&N);

    int x,y;

    int xx,yy;

    int count=0;

    for(int i=0;i<N;i++)

    {

       scanf("%d%d",&x,&y);

       for(int i=-1;i<=1;i++)

       {

           for(int j=-1;j<=1;j++)

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

    memset(ans,0,sizeof(ans));

    for(int i=0;i<count;i++)

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

    printf("%lld\n",z);

    for(int i=1;i<10;i++)

        printf("%lld\n",ans[i]);

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<map>

#include<set>

#define MAXN 100000

using namespace std;

typedef long long LL;

typedef pair<int,int> PII;

map<PII,bool> vis;

set<PII> exist;

int a[MAXN+5],b[MAXN+5];

int dir[9][2]={{-2,-2},{-2,0},{0,-2},{0,0},{-1,-2},{-2,-1},{-1,0},{0,-1},{-1,-1}};

LL ans[10]={};

int main()

{

	int H,W,N;

	scanf("%d %d",&H,&W);

	scanf("%d",&N);

	for(int i=1;i<=N;i++)

	{

		scanf("%d %d",&a[i],&b[i]);

		exist.insert(PII(a[i],b[i]));

	}

	LL tot=1LL*(1LL*H-2LL)*(1LL*W-2LL);

	for(int i=1;i<=N;i++)

	{

		int bgx,bgy;

		for(int p=0;p<9;p++)

		{

			bgx=a[i]+dir[p][0];

			bgy=b[i]+dir[p][1];

			if(bgx<=0||bgy<=0||bgx>H||bgy>W)

				continue;

			if(bgx+2<=0||bgy+2<=0||bgx+2>H||bgy+2>W)

				continue;

			if(vis[PII(bgx,bgy)]==true)

				continue;

			LL cnt=0;

			for(int x=bgx;x<=bgx+2;x++)

				for(int y=bgy;y<=bgy+2;y++)

				{

					if(exist.find(PII(x,y))!=exist.end())

						cnt+=1LL;

				}

			vis[PII(bgx,bgy)]=true;

			ans[cnt]+=1LL;

		}

	}

	ans[0]+=tot-vis.size();

	for(int i=0;i<=9;i++)

		printf("%lld\n",ans[i]);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.7234757022005915x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

    scanf("%d%d%d",&H,&W,&N);

    int x,y;

    int xx,yy;

    int count=0;

    for(int i=0;i<N;i++)

    {

       scanf("%d%d",&x,&y);

       for(int i=-1;i<=1;i++)

       {

           for(int j=-1;j<=1;j++)

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

    memset(ans,0,sizeof(ans));

    for(int i=0;i<count;i++)

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

    printf("%lld\n",z);

    for(int i=1;i<10;i++)

        printf("%lld\n",ans[i]);

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<algorithm>

#include<set>

#define maxn 100005

#define maxm 15

#define LL long long

using namespace std;

typedef pair<int,int> PII;

set<PII> used;

int h,w,n,dir[9][2]={{0,0},{1,0},{0,1},{-1,0},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}};

PII a[maxn];

LL ans[maxm];

int main()

{

	scanf("%d%d%d",&h,&w,&n);

	for(int i=1;i<=n;i++) scanf("%d%d",&a[i].first,&a[i].second);

	sort(a+1,a+n+1);

	ans[0]=1ll*(h-2)*(w-2);

	for(int i=1;i<=n;i++)

	{

		int cnt,x=a[i].first,y=a[i].second;

		//if(x==1||y==1||x==h||y==w) continue;

		for(int j=0;j<9;j++)

		{

			cnt=0;

			int tx=x+dir[j][0],ty=y+dir[j][1];

			if(tx<=1||ty<=1||tx>=h||ty>=w) continue;

			if(used.find(PII(tx,ty))!=used.end()) continue;

			cnt+=upper_bound(a+1,a+n+1,PII(tx-1,ty+1))-lower_bound(a+1,a+n+1,PII(tx-1,ty-1));

			cnt+=upper_bound(a+1,a+n+1,PII(tx,ty+1))-lower_bound(a+1,a+n+1,PII(tx,ty-1));

			cnt+=upper_bound(a+1,a+n+1,PII(tx+1,ty+1))-lower_bound(a+1,a+n+1,PII(tx+1,ty-1));

			ans[cnt]++;

			ans[0]--;

			used.insert(PII(tx,ty));

			//printf(" * %d %d %d\n",tx,ty,cnt);

		}

	}

	for(int i=0;i<=9;i++) printf("%lld\n",ans[i]);

}

// Faster C++ solution for the same problem (measured speedup: 4.696615762129091x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

    scanf("%d%d%d",&H,&W,&N);

    int x,y;

    int xx,yy;

    int count=0;

    for(int i=0;i<N;i++)

    {

       scanf("%d%d",&x,&y);

       for(int i=-1;i<=1;i++)

       {

           for(int j=-1;j<=1;j++)

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

    memset(ans,0,sizeof(ans));

    for(int i=0;i<count;i++)

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

    printf("%lld\n",z);

    for(int i=1;i<10;i++)

        printf("%lld\n",ans[i]);

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<iostream>

#include<cstring>

#include<algorithm>

using namespace std;

typedef long long ll;

const int MAXN=int(1e5)+7;

int x,y,h,w,n;

ll ans[20],base=int(1e9)+7,zero,a[MAXN<<4],tot;

int main()

{

	scanf("%d%d%d",&h,&w,&n);

	zero=1ll*(h-2)*(w-2);

	while(n--)

	{

		scanf("%d%d",&x,&y);

		for(int i=0;i<3;i++)

			for(int j=0;j<3;j++)

				if(1<=x-i&&x-i<=h-2&&1<=y-j&&y-j<=w-2)

					a[tot++]=base*(x-i)+(y-j);

	}

	sort(a,a+tot);

	for(int i=0,cnt=1;i<tot;i++)

	{

		if(a[i]==a[i+1])

			cnt++;

		else

			ans[cnt]++,cnt=1,zero--;	

	}

	printf("%lld\n",zero);

	for(int i=1;i<10;i++)

		printf("%lld\n",ans[i]);

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.915854290254741x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

    scanf("%d%d%d",&H,&W,&N);

    int x,y;

    int xx,yy;

    int count=0;

    for(int i=0;i<N;i++)

    {

       scanf("%d%d",&x,&y);

       for(int i=-1;i<=1;i++)

       {

           for(int j=-1;j<=1;j++)

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

    memset(ans,0,sizeof(ans));

    for(int i=0;i<count;i++)

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

    printf("%lld\n",z);

    for(int i=1;i<10;i++)

        printf("%lld\n",ans[i]);

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<iostream>

#include<cstring>

#include<algorithm>

#define RG register

#define LL long long

using namespace std;

const int N=9e5+10;

int n,cnt,num=1;

LL h,w,col[N],ans[12],zro;

template<typename I> inline void read(I &ot){

	I ch=getchar(), x=0, f=1;

	while(ch<'0' || ch>'9'){if(ch=='-') f=-1; ch=getchar();	}

	while(ch>='0' && ch<='9'){x=x*10+ch-'0'; ch=getchar();	}

	ot=x*f;}

template<typename I, typename... U> inline void read(I &x,U&... y){read(x); read(y...);}

int main()

{

//	freopen("Snuke's Coloring.in","r",stdin);

	//freopen(".out","w",stdout);

	read(h,w,n); zro=(h-2)*(w-2);

	for(int i=1,a,b;i<=n;i++)

	{

		read(a,b);

		for(int x=-2;x<=0;x++)

		 for(int y=-2;y<=0;y++)

		  if(a+x>0 && a+x<=h-2 && b+y>0 && b+y<=w-2)

		   col[++cnt]=(a+x-1)*(w-2)+(b+y);

	}

	sort(col+1,col+cnt+1);

	for(int i=1;i<=cnt;i++)

	 if(col[i]==col[i+1]) num++;

	 else ans[num]++, zro--, num=1;

	printf("%lld\n",zro);

	for(int i=1;i<10;i++) printf("%lld\n",ans[i]);

	//fclose(stdin); fclose(stdout);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.883675807257413x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

    scanf("%d%d%d",&H,&W,&N);

    int x,y;

    int xx,yy;

    int count=0;

    for(int i=0;i<N;i++)

    {

       scanf("%d%d",&x,&y);

       for(int i=-1;i<=1;i++)

       {

           for(int j=-1;j<=1;j++)

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

    memset(ans,0,sizeof(ans));

    for(int i=0;i<count;i++)

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

    printf("%lld\n",z);

    for(int i=1;i<10;i++)

        printf("%lld\n",ans[i]);

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main() {

	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

	int n;

	string s;

	cin>>n>>s;

	string t;

	for(int i=0; i<(int)s.size(); ++i) {

		int c = (int)s[i] - 'A';

		c = (c+n)%(26);

		t += (char)c+'A';

	}

	cout<<t;

}


// Faster C++ solution for the same problem (measured speedup: 5.329543874194109x):
#include <stdio.h>

#include <string.h>



int main(){

	int x,y;

	scanf("%d",&x);

	char a[10000];

	scanf("%s",a);

	int len=strlen(a);

	for(int i=0; i<len;i++){

		a[i]+=x;

		if(a[i]>'Z'){

			a[i]-=26;

		}

		printf("%c",a[i]);

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define pi 3.14159

using namespace std;

typedef long long LL;

const LL MOD = 1e9 + 7;

const int N = 2e7 + 9, M = 1e7, OO = 0x3f3f3f3f;

int main()

{

int n;

	string s;



	cin >> n >> s;



	for (int i = 0; i < s.size(); i++) {

		int ch = (s[i] -'A') + n;

		char ch2 = (ch % 26) + 'A';



		cout << (char)ch2 ;



	}

	cout << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.242614388988222x):
#include <stdio.h>

#include <string.h>



int main(){

	int x,y;

	scanf("%d",&x);

	char a[10000];

	scanf("%s",a);

	int len=strlen(a);

	for(int i=0; i<len;i++){

		a[i]+=x;

		if(a[i]>'Z'){

			a[i]-=26;

		}

		printf("%c",a[i]);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,x;

    string s;

    cin>>n>>s;

    for(int i=0 ; i<s.size(); i++)

    {



        x=s[i]+n;

        if(x>90)

        s[i]=65-(91-x);

        else

            s[i]=s[i]+n;

    }

    cout<<s;

   return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.258815358015967x):
#include <stdio.h>

#include <string.h>



int main(){

	int x,y;

	scanf("%d",&x);

	char a[10000];

	scanf("%s",a);

	int len=strlen(a);

	for(int i=0; i<len;i++){

		a[i]+=x;

		if(a[i]>'Z'){

			a[i]-=26;

		}

		printf("%c",a[i]);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long int ll;

int main()

{

   string s; int i,t, k;

   cin>>k>>s;

   if(k==0) cout<<s;

   else

   {

       for(i=0;i<s.size();i++)

       {

           if( (char) s[i]+k <='Z')

           {

               s[i]=s[i]+k;

           }

           else

           {

              t=64 + (k-( 'Z'-s[i]));

               s[i]=  (char)t;

           }

       }

       cout<<s<<endl;

   }



}


// Faster C++ solution for the same problem (measured speedup: 5.233042649523728x):
#include <stdio.h>

#include <string.h>



int main(){

	int x,y;

	scanf("%d",&x);

	char a[10000];

	scanf("%s",a);

	int len=strlen(a);

	for(int i=0; i<len;i++){

		a[i]+=x;

		if(a[i]>'Z'){

			a[i]-=26;

		}

		printf("%c",a[i]);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    string S;

    int n;



    cin >> n;

    cin >> S;

    int len = S.size();

    for(int i = 0; i < len; i++)

    {

        /*while(n--)

        {

            S[i] = S[i]+ 1;

            if(S[i] == 'Z')

            {

                S[i]

            }

        }*/

        S[i] = S[i] + n;

        if(S[i] <= 'Z')

        {

            cout << S[i];

        }

        else

        {

            int x = S[i] - 'Z';

            S[i] = 64 + x;

            cout << S[i];

        }

        

    }

    cout << endl;

}






// Faster C++ solution for the same problem (measured speedup: 5.285067663987651x):
#include <stdio.h>

#include <string.h>



int main(){

	int x,y;

	scanf("%d",&x);

	char a[10000];

	scanf("%s",a);

	int len=strlen(a);

	for(int i=0; i<len;i++){

		a[i]+=x;

		if(a[i]>'Z'){

			a[i]-=26;

		}

		printf("%c",a[i]);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main() {

	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

	int n;

	string s;

	cin>>n>>s;

	string t;

	for(int i=0; i<(int)s.size(); ++i) {

		int c = (int)s[i] - 'A';

		c = (c+n)%(26);

		t += (char)c+'A';

	}

	cout<<t;

}


// Faster C++ solution for the same problem (measured speedup: 5.3403617704250115x):
#include<stdio.h>

int main(){

	int a;

	scanf("%d", &a);

	char b[10001];

	scanf("%s", b);

	for(int i=0; b[i]!='\0'; i++){

		b[i]+=a;

		if(b[i]>'Z'){

			b[i]-=26;

		}

		printf("%c", b[i]);

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define pi 3.14159

using namespace std;

typedef long long LL;

const LL MOD = 1e9 + 7;

const int N = 2e7 + 9, M = 1e7, OO = 0x3f3f3f3f;

int main()

{

int n;

	string s;



	cin >> n >> s;



	for (int i = 0; i < s.size(); i++) {

		int ch = (s[i] -'A') + n;

		char ch2 = (ch % 26) + 'A';



		cout << (char)ch2 ;



	}

	cout << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.253255835944559x):
#include<stdio.h>

int main(){

	int a;

	scanf("%d", &a);

	char b[10001];

	scanf("%s", b);

	for(int i=0; b[i]!='\0'; i++){

		b[i]+=a;

		if(b[i]>'Z'){

			b[i]-=26;

		}

		printf("%c", b[i]);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,x;

    string s;

    cin>>n>>s;

    for(int i=0 ; i<s.size(); i++)

    {



        x=s[i]+n;

        if(x>90)

        s[i]=65-(91-x);

        else

            s[i]=s[i]+n;

    }

    cout<<s;

   return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.269489689662988x):
#include<stdio.h>

int main(){

	int a;

	scanf("%d", &a);

	char b[10001];

	scanf("%s", b);

	for(int i=0; b[i]!='\0'; i++){

		b[i]+=a;

		if(b[i]>'Z'){

			b[i]-=26;

		}

		printf("%c", b[i]);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long int ll;

int main()

{

   string s; int i,t, k;

   cin>>k>>s;

   if(k==0) cout<<s;

   else

   {

       for(i=0;i<s.size();i++)

       {

           if( (char) s[i]+k <='Z')

           {

               s[i]=s[i]+k;

           }

           else

           {

              t=64 + (k-( 'Z'-s[i]));

               s[i]=  (char)t;

           }

       }

       cout<<s<<endl;

   }



}


// Faster C++ solution for the same problem (measured speedup: 5.243664667784717x):
#include<stdio.h>

int main(){

	int a;

	scanf("%d", &a);

	char b[10001];

	scanf("%s", b);

	for(int i=0; b[i]!='\0'; i++){

		b[i]+=a;

		if(b[i]>'Z'){

			b[i]-=26;

		}

		printf("%c", b[i]);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    string S;

    int n;



    cin >> n;

    cin >> S;

    int len = S.size();

    for(int i = 0; i < len; i++)

    {

        /*while(n--)

        {

            S[i] = S[i]+ 1;

            if(S[i] == 'Z')

            {

                S[i]

            }

        }*/

        S[i] = S[i] + n;

        if(S[i] <= 'Z')

        {

            cout << S[i];

        }

        else

        {

            int x = S[i] - 'Z';

            S[i] = 64 + x;

            cout << S[i];

        }

        

    }

    cout << endl;

}






// Faster C++ solution for the same problem (measured speedup: 5.295795282506592x):
#include<stdio.h>

int main(){

	int a;

	scanf("%d", &a);

	char b[10001];

	scanf("%s", b);

	for(int i=0; b[i]!='\0'; i++){

		b[i]+=a;

		if(b[i]>'Z'){

			b[i]-=26;

		}

		printf("%c", b[i]);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main() {

	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

	int n;

	string s;

	cin>>n>>s;

	string t;

	for(int i=0; i<(int)s.size(); ++i) {

		int c = (int)s[i] - 'A';

		c = (c+n)%(26);

		t += (char)c+'A';

	}

	cout<<t;

}


// Faster C++ solution for the same problem (measured speedup: 5.369890051591663x):
#include <stdio.h>

#include <string.h>

 

int main (){

 

    int n;

    scanf("%d", &n);

    char arr[10000];

    scanf("%s", arr);

    for(int i = 0; i < strlen(arr); i++){

        arr[i] = arr[i] + n;

        if(arr[i] >= 91) arr[i] -= 26;

    }

 

    printf("%s", arr);

 

 	return 0;

}