#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	fstream file;

	file.open("prenom.txt",fstream::in);
	if(!file.is_open())
		return 1;

  string mot;
	vector<string> prenoms;
  while(file>>mot)
	 prenoms.push_back(mot);

	file.close();

	sort(prenoms.begin(),prenoms.end());

  fstream fout;
	fout.open("prenom_trie.txt",fstream::out);
	if(!fout.is_open())
		return 1;
	for(unsigned i = 0; i< prenoms.size();++i)
	{
		fout << prenoms[i] << endl;
	}
  fout.close();


	
	return 0;
}
