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