// 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
Ly8gaW9zdHJlYW0gaXMgdG9vIG1haW5zdHJlYW0KI2luY2x1ZGUgPGNzdGRpbz4KLy8gYml0Y2ggcGxlYXNlCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDx2ZWN0b3I+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxtYXA+CiNpbmNsdWRlIDxxdWV1ZT4KI2luY2x1ZGUgPHN0YWNrPgojaW5jbHVkZSA8bGlzdD4KI2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8aW9tYW5pcD4K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