#include #include #include #include using namespace std; void nacitaj(string& s) { char c; cin.get(c); while(c!='\n') { if(c!=' ') s.push_back(toupper(c)); cin.get(c); } } int main() { string s,vys; int skok; int x; vys.resize(10000); while(true) { cin >> skok; if(skok == 0) return 0; if(skok!=0) cin.get(); s.erase(s.begin(),s.end()); nacitaj(s); x=0; vys.erase(vys.begin(),vys.end()); vys.resize(10000); if(s.length()<=skok) cout << s << endl; else { for (int i=0;i<=skok;i++) { for(int j=1+i;j<=s.length();j=j+skok) { if(x>=s.length()) break; //cout << j << endl; vys[j] = s[x]; //cout<< s[x]; x++; } } } if(not (s.length()<=skok)) cout << vys << endl; } }