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

bool prviVeci(string a,string b)
{
	for (int i = 0; i < a.length(); i++)
	{
		if ((a[i] - '0')>(b[i] - '0'))
		{
			return false;
		}
		else
		if ((b[i] - '0')>(a[i] - '0'))
		{
			return true;
		}
		
	}
	
	return false;

}







int main()
{
	string a, b, c;

	cin >> a >> b >> c;

	string abc, acb, bca, bac, cba, cab;

	abc = a + b + c;
	acb = a + c + b;
	bca = b + c + a;
	bac = b + a + c;
	cba = c + b + a;
	cab = c + a + b;

	string maxVal = abc;

	if (prviVeci(maxVal, acb))
		maxVal = acb;
	if (prviVeci(maxVal, bca))
		maxVal = bca;
	if (prviVeci(maxVal, bac))
		maxVal = bac;
	if (prviVeci(maxVal, cba))
		maxVal = cba;
	if (prviVeci(maxVal, cab))
		maxVal = cab;

	cout << maxVal;


	return 0;
}