#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
int main()
{
    int n;
    vector<string> s;
    string tmp;
    while(cin>>n)
    {
        for(int i=0;i<n;i++)
        {
            cin>>tmp;
            s.push_back(tmp);
        }
        sort(s.begin(),s.end());

    }
    for(auto x:s) cout<<x<<endl;

    return 0;
}