#include <iostream>
#include <string>
//算法函数库,用到了排序
#include <algorithm>
using namespace std;
bool cmp(string a,string b)
{
return (a < b);
}
int main()
{
int n;
cin >> n;
string str[1000];
for (int i = 0; i < n; i++)
{
cin >> str[i];
}
//排序函数,对字符串进行排序,cmp函数指明排序方向(从小到大)
sort(str, str + n,cmp);
for (int i = 0; i < n; i++)
{
cout << str[i] << endl;
}
}