#include <iostream>
#include<string>
int main()
{
	std::string a, b, c;
	std::cin >> a >> b >> c;
	std::string s1, s2, s3, s4, s5, s6;
	//s1 = s2 = s3 = s4 = s5 = s6 = "";
	s1+= a + b + c;
	s2+= a + c + b;
	s3+= c + b + a;
	s4+= b + c + a;
	s5+= b + a + c;
	s6+=c + a + b;
	int d = s1.size();
	std::string smax;
	smax = s1;
	if (s2 > smax)
		smax = s2;
	if (smax < s3)
		smax = s3;
	if (smax < s4)
		smax = s4;
	if (smax < s5)
		smax = s5;
	if (smax < s6)
		smax = s6;
	std::cout << smax;
	//return main();
}