#include <iostream>
#include <string>

using namespace std;

int main()
{
	string a, b, c, x, ab, ba;
	cin >> a;
	cin >> b;
	cin >> c;
	ab = a + b;
	ba = b + a;
	if(ab.compare(ba) > 0)
		x = ab;
	else
		x = ba;
	if(x.compare(c) > 0)
		cout << x + c;
	else
		cout << c + x;
	return 0;
}