#include <iostream>
#include <string>

using namespace std;

int main()
{
	string A,B,C;
	cin >> A >> B >> C;
	string r1 = A+B+C;
	string r2 = A+C+B;
	string r3 = B+A+C;
	string r4 = B+C+A;
	string r5 = C+B+A;
	string r6 = C+A+B;
	cout << max(r1,max(r2,max(r3,max(r4,max(r5,r6)))));

}