#include <set>
#include <string>;
#include <iostream>
using namespace std;

int main()
{
	multiset<string> set_s;

	for (;;) {
		string s;

		getline(cin, s);

		if (s.empty()) break;
		else {
			set_s.insert(s);
		}
	}

	for (auto i = set_s.begin(); i != set_s.end(); ++i) {
		cout << *i << endl;
	}

    return 0;
}

