#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
//英语 模拟 gets puts 背
char a[100008][12];//抄博友程序
int main()
{
gets(a[0]);
puts(a[0]);
int i=1;
int k=0;
while(gets(a[i]))//抄博友程序
{
int js=0;
for(int j=0;a[i][j]!=0 && a[i-1][j]!=0;j++)
{
if(a[i][j]==a[i-1][j])
{
js++;
}else
{
break;
}
}
if(js>k)
{
k++;
}else
{
k=js;
}
for(int j=0;j<k;j++)
{
//printf(" ");//tle
cout<<' ';//ac
}
puts(a[i]);
i++;
}
return 0;
}