#include<iostream>
#include<algorithm>
using namespace std;
class Student{
public:
string x;
};
short comp(const Student &a,const Student &b)
{
return a.x>b.x;
}
int main()
{
Student a[5];
int i;
for(i=0;i<5;i++)
cin>>a[i].x;
sort(a+0,a+5,comp);
for(i=0;i<5;i++)
cout<<a[i].x<<" ";
cout<<endl;
}