// Problem#: 1007
// Submission#: 4893204
// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/
// All Copyright reserved by Informatic Lab of Sun Yat-sen University
/*今天在实验室快要完成的时候刚好遇到关机,就在找到bug的时候,回来把bug一改就刚好做了,题目要求就是把一串字符串按照一定的顺序存入,诸如/* 1 2 3 4 5
/*10 9 8 7 6
/*11 12 13 14 15
/*20 19 18 17 16
然后输出就是 1 10 11 20 2 .。。。。。。。5 6 15 16 //这里的数字只是一个位置·
*/
#include<iostream>
#include<string>
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
int column;
while(cin>>column&&column){
string s;
getchar();
getline(cin,s,'\n');
int len = s.length();
while(len%column!=0){
s = s + "x";
len = s.length();
}
len = s.length();
int row = len/column;
char max[row][column];
int base = 0;
for(int i=0;i<row;i++){
if(i%2==0){
for(int j=0;j<column;j++){
max[i][j] = s[base];
base ++;
}
}
else{
for(int j=column-1;j>=0;j--){
max[i][j] = s[base];
base ++;
}
}
}
for(int i=0;i<column;i++){
for(int j=0;j<row;j++){
cout<<max[j][i];
}
}
cout<<endl;
}
return 0;
}