#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
string sec;
int key,length;
int ids,sec_code;
int mod(int x, int y) {
int z = x%y;
return z>=0?z:z+y;
}
int toint(char c) {
if(c=='_') return 0;
if(c=='.') return 27;
return (int)c-96;
}
char tochar(int i) {
if(i==0) return '_';
if(i==27) return '.';
return (char)(i+96);
}
int main() {
while(cin>>key && key) {
cin>>sec;
length = sec.length();
char target[length];
for (int i = 0; i < length; ++i)
{
sec_code = toint(sec[i]);
ids = key*i%length;
target[ids] = tochar(mod(sec_code+i, 28));
}
target[length]='\0';
cout<<target<<endl;
}
return 0;
}
#include <string>
#include <iostream>
using namespace std;
string sec;
int key,length;
int ids,sec_code;
int mod(int x, int y) {
int z = x%y;
return z>=0?z:z+y;
}
int toint(char c) {
if(c=='_') return 0;
if(c=='.') return 27;
return (int)c-96;
}
char tochar(int i) {
if(i==0) return '_';
if(i==27) return '.';
return (char)(i+96);
}
int main() {
while(cin>>key && key) {
cin>>sec;
length = sec.length();
char target[length];
for (int i = 0; i < length; ++i)
{
sec_code = toint(sec[i]);
ids = key*i%length;
target[ids] = tochar(mod(sec_code+i, 28));
}
target[length]='\0';
cout<<target<<endl;
}
return 0;
}