#include <iostream>
#include <string>
using namespace std;
//程式目的:行列互換
int main() {
string s[105];
int row = 0, col = 0, maxi=0;
while (getline(cin, s[row])) {
maxi = max(maxi, (int)s[row].length());
row++;
}
for (int i = 0; i < maxi; i++) {
for (int j = row - 1; j >= 0; j--) {
if (i >= (int)s[j].length()) { //當行比列的字串長度還長時輸出空格
cout << " ";
}
else {
cout << s[j][i];
}
}
cout << "\n";
}
return 0;
}