#include const int ldiff = 'a' - 'A'; int main() { int n, counter, len; char buf[10001], res[10001], *bufp = buf; char c; while (1) { scanf("%d\n", &n); if (n == 0) break; bufp = buf; while ((c = getchar()) != '\n') { if (c != ' ') { if (c >= 'A' && c <= 'Z') *bufp = c; else *bufp = c - ldiff; ++bufp; } } *bufp = '\0'; len = bufp - buf; int i, j = 0; counter = 0; for (i = 0; i < len; ++i) { if (j >= len) { j = ++counter; } res[j] = buf[i]; j += n; } res[len] = '\0'; printf("%s\n", res); } return 0; }