/*C++ STL map 又水水地哒哒哒过了*/
#include<iostream>
#include<string>
#include<string.h>
#include<map>
using namespace std;
int main()
{
int i=0;
map<char,int> shuzi;
map<int,char> zifu;
shuzi['_']=0;
zifu[0]='_';
zifu[27]='.';
shuzi['.']=27;
for( i=0;i<26;i++)
{
char tmp='a';
shuzi[tmp+i]=i+1;
zifu[i+1]=tmp+i;
}
int k=0;
string str="";
int pre[100];
int pos[100];
memset(pre,0,sizeof(pre));
memset(pos,0,sizeof(pos));
while(cin>>k&&k!=0)
{
cin>>str;
int len=str.length();
for(i=0;i<len;i++)
{
pre[i]=shuzi[str[i]];
}
for(i=0;i<len;i++)
{
int tmp=pre[i]+i;
if(tmp>=28)
tmp=tmp%28;
int index=k*i%len;
pos[index]=tmp;
}
for(i=0;i<len;i++)
{
cout<<zifu[pos[i]];
}
cout<<endl;
}
return 0;
}
/*
101 thqqxw.lui.qswer
5 cs.
3 b_ylxmhzjsys.virpbkr
0
*/