#include <iostream>
#include <string>
using namespace std;

int main()
{
	string str1,str2,str3;
	
	cin >> str1 >> str2 >> str3;
	
	string a1,b1,c1,d1,e1,f1;
	
	a1=str1+str2+str3;
	b1=str1+str3+str2;
	c1=str2+str1+str3;
	d1=str2+str3+str1;
	e1=str3+str1+str2;
	f1=str3+str2+str1;
	
	string maax = a1;
	
	if(maax < b1)
	{
		cout << b1 << endl;
	}
	else if(maax < c1)
	{
		cout << c1 << endl;
	}
	else if(maax < d1)
	{
		cout << d1 << endl;
	}
	else if(maax < e1)
	{
		cout << e1 << endl;
	}
	else if(maax < f1)
	{
		cout << f1 << endl;
	}
	
}