#include <vector>
#include <iostream>
#include <string>

using namespace std;

main(){
  vector<string> cadenas;
  char cad[20];
  int i,j;
  while(strcmp(cad,"fin")){
    cin >> cad;
    if(strcmp(cad,"fin")!=0)
      cadenas.push_back(cad);
  }
  sort(cadenas.begin(),cadenas.end());
  for(i = 0;i<cadenas.size();i++)
    cout << cadenas[i]<<endl;
  system("pause");
}
