// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-6
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
using namespace std;
// mylittledoge

int N;
vector<string> L;
vector<int> P;

void calc(int z, int k, int s) {
//	cout << z << " " << k << " " << s << endl;
	int c =-1;
	for(int i =z; i < k; i++) {
		if(L[i].length() > s && L[i][s]-'a' != c) {
			for(int j =i+1; j <= k; j++) {
				if(j == k || L[j].length() <= s || L[j][s] != L[i][s]) {
					calc(i+1,j,s+1);
					break;}
				else P[j]++;}
			}
		c =(L[i].length() > s)?(L[i][s]-'a'):-i-2;}
	}

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	string s;
	while(getline(cin,s)) {
		if(s.empty()) break;
		N++;
		L.push_back(s);}
	P.resize(N);
	calc(0,N,0);
	for(int i =0; i < N; i++) {
//		cout << P[i] << " ";
		for(int j =0; j < P[i]; j++) cout << " ";
		cout << L[i] << "\n";}
	return 0;}

// look at my code
// my code is amazing