#include<iostream>
#include<string>
using namespace std;
main()
{
	string a,b,c;
	cin>>a;
	cin>>b;
	cin>>c;
	string s[6];
	string max;
	s[0] = a+b+c;
	s[1] = a+c+b;
	s[2] = b+a+c;
	s[3] = b+c+a;
	s[4] = c+a+b;
	s[5] = c+b+a;
	for(int i = 0;i < 6;i++)
	{
		if(max < s[i])
		{
			max = s[i];
		}
	}
	cout<<max<<endl;
}