#include<fstream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
string stemp;
vector<string> v1;
ifstream in ("substring.in");
ofstream out ("substring.out");
int main ()
{
in>>stemp;
while (in>>stemp)
v1.push_back(stemp);
sort(v1.begin(),v1.end());
for (vector<string>::iterator it = v1.begin();it<v1.end();++it)
out<<*it<<endl;
return 0;
}