#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
using namespace std;
char str[120][120];
int main(){
#ifdef LOCAL
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
#endif
int i = 0;
while(gets(str[i])) i++;
for(int j = 1; j < i; j++){
if(strlen(str[j]) < strlen(str[j - 1])){
for(int k = strlen(str[j]); k <= strlen(str[j - 1]); k++){
str[j][k] = ' ';
}
str[j][strlen(str[j - 1])] = '\0';
}
}
int len = strlen(str[i - 1]);
//puts(str[0]);
//puts(str[1]);
//puts(str[2]);
for(int k = 0; k < len; k++){
for(int j = i - 1; j >= 0; j--){
if(k <= strlen(str[j])){
printf("%c", str[j][k]);
}
else continue;
}
printf("\n");
}
return 0;
}
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
using namespace std;
char str[120][120];
int main(){
#ifdef LOCAL
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
#endif
int i = 0;
while(gets(str[i])) i++;
for(int j = 1; j < i; j++){
if(strlen(str[j]) < strlen(str[j - 1])){
for(int k = strlen(str[j]); k <= strlen(str[j - 1]); k++){
str[j][k] = ' ';
}
str[j][strlen(str[j - 1])] = '\0';
}
}
int len = strlen(str[i - 1]);
//puts(str[0]);
//puts(str[1]);
//puts(str[2]);
for(int k = 0; k < len; k++){
for(int j = i - 1; j >= 0; j--){
if(k <= strlen(str[j])){
printf("%c", str[j][k]);
}
else continue;
}
printf("\n");
}
return 0;
}