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