#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main()
{
	string a, b, c;
	cin >> a >> b >> c;
	int finals[6];
	if(a == b && a == c)
	{
		cout << a + b + c;
		return 0;
	}
	else if(a == b)
	{
		finals[0] = stoi(a + a + c);
		finals[1] = stoi(a + c + a);
		finals[2] = stoi(c + a + a);
		cout << *std::max_element(finals,finals+3);
		return 0;
	}
	else if (a == c)
	{
		finals[0] = stoi(a + a + b);
		finals[1] = stoi(a + b + a);
		finals[2] = stoi(b + a + a);
		cout << *std::max_element(finals,finals+3);
		return 0;
	}
	else if(b == c)
	{
		finals[0] = stoi(b + b + a);
		finals[1] = stoi(b + a + b);
		finals[2] = stoi(a + b + b);
		cout << *std::max_element(finals,finals+3);
		return 0;
	}
	else
	{
		finals[0] = stoi(a + b + c);
		finals[1] = stoi(a + c + b);
		finals[2] = stoi(b + a + c);
		finals[3] = stoi(b + c + a);
		finals[4] = stoi(c + a + b);
		finals[5] = stoi(c + b + a);
		cout << *std::max_element(finals,finals+6);
		return 0;
	}
}