#include<iostream>
#include<vector>
#include<string>
#include<sstream>
#include<algorithm>
using namespace std;

int main() {
    string input;
    if(!getline(cin, input) || input.empty()) 
    return 0;
    
    for(char c : input) {
        if(!isalpha(c) && c != ' '){
            cout<<"Invalid input"<<endl;
            return 0;
        }
    }
    vector<string> words;
    stringstream ss(input);
    string word;
    int maxLen = 0;
    while(ss>>word){
        words.push_back(word);
        maxLen = max((int)word.length(), maxLen);
        for(int i = 0; i<maxLen; ++i){
            string line= " ";
            for(const string &w : words){
                if(i<w.length()){
                    line+=' ';
                }
            }
            size_t last = line.find_last_not_of(' ');
            if(last!= string :: npos) {
                cout<<line.substr(0, last+1)<<endl;
            }
        }
        return 0;
    }