#include <stdio.h> #include <string.h> int main(void) { int i, n, k,j,m; char pt[100], ct[100]; int cc[100], pc[100]; while (scanf("%d%s",&k,ct) != 0 && k) { n = strlen(ct); for (i = 0; i < n; i++) { if (ct[i] >= 'a' && ct[i] <= 'z') cc[i] = ct[i] - 'a' + 1; else if (ct[i] == '.' ) cc[i] = 27; else if (ct[i] == '_' ) cc[i] = 0; } for (i = 0; i < n; i++) { j = (k * i) % n; for (m = 0; m <= 27; m++) { if( (m - i + 2800) % 28 == cc[i])pc[j] = m; } } for (j=0; j<n; j++) { if (pc[j] >= 1 && pc[j] <= 26 ) pt[j] = pc[j] + 'a' - 1; else if (pc[j] == 0) pt[j] = '_'; else if (pc[j] == 27) pt[j] = '.'; } pt[n] = '/0'; puts(pt); } return 0; }