#include<iostream>
#include<string>

using namespace std;

//string brojevi[7];

int main()
{
	string a,b,c,br1,br2,br3,br4,br5,br6,maxbr;
	cin>>a>>b>>c;
	br1=a+b+c;
	br2=a+c+b;
	br3=b+a+c;
	br4=b+c+a;
	br5=c+a+b;
	br6=c+b+a;
	maxbr=br1;
	//string brojevi[6]={a+b+c,a+c+b,b+a+c,b+c+a,c+a+b,c+b+a};
	string brojevi[6]={br1,br2,br3,br4,br5,br6};
	for(int i=0;i<6;i++)
	{	
		//cout<<brojevi[i]<<endl;
		if(maxbr.compare(brojevi[i])<=0)
			maxbr=brojevi[i];
	}
	cout<<maxbr<<endl;
	
}