#include #include #include #include using namespace std; int main(){ char *str; char *str2; int sifra, delka, i; char c, k, s; while(1){ scanf("%d", &sifra); if(sifra == 0){ return 0; } i = 0; while((c = getchar()) != '\n'){ } str = new char[11001]; str2 = new char[11001]; while(1){ scanf("%c", &c); if(c == '\n'){ break; } if(c == ' '){ continue; } str[i] = c; i++; } str[i] = '\0'; delka = i; k = 0; s = 0; for(int j = 0; j < delka; j++){ if((s * sifra) + k >= delka){ k++; s = 0; } str2[((s * sifra)) + k] = toupper(str[j]); // printf("%c %d\n", toupper(str[j]),((s * sifra)) + k); s++; } str2[delka] = '\0'; //printf("%s\n", str2); cout << str2 << endl; } return 0; }