#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ldb long double
#define mt make_tuple
string A,B,C;
string sol,bsol;
void input()
{
	cin>>A>>B>>C;
}
void output()
{
	cout<<sol<<"\n";
}
bool comp(string a, string b)
{
	string x=a+b,y=b+a;
	for(int i=0;i<x.size();i++)
	{
		if(x[i]<y[i]) return 0;
		if(x[i]>y[i]) return 1;
	}
	return 0;
};
void Solve()
{
	vector<string> v={A,B,C};
	sort(v.begin(),v.end(),comp);
	sol=v[0]+v[1]+v[2];
}
void Run()
{
	input();
	Solve();
	output();
}
void BruteForce()
{
	vector<string> v={A,B,C},o;
	vector<int> p={0,1,2};
	do
	{
		string tmp;
		for(int i=0;i<3;i++) tmp+=v[p[i]];
		o.pb(tmp);
	}while(next_permutation(p.begin(),p.end()));
	bsol=o[0];
	for(int i=1;i<o.size();i++)
	{
		bool ok=0;
		for(int j=0;j<bsol.size();j++)
		{
			if(bsol[j]<o[i][j]){ ok=1;break;}
			if(bsol[j]>o[i][j]) break;
		}
		if(ok) bsol=o[i];
	}
}
void MakeTestCase()
{
	A=to_string((int)(rand()%1000000000+1));
	B=to_string((int)(rand()%1000000000+1));
	C=to_string((int)(rand()%1000000000+1));
}
bool Compare()
{
	if(sol.size()!=bsol.size()) return 0;
	for(int i=0;i<sol.size();i++) if(sol[i]!=bsol[i]) return 0;
	return 1;
}
void Print()
{
	cout<<A<<" "<<B<<" "<<C<<"\n";
	cout<<"Solve: "<<sol<<"\n";
	cout<<"Brute: "<<bsol<<"\n";
}
double GetTime(){ return (ldb)clock()/CLOCKS_PER_SEC;}
double s_time,e_time,d_time;
void Start(){ s_time=GetTime();}
void Stop(){ e_time=GetTime();d_time=e_time-s_time;}
void Test()
{
	cout<<fixed<<setprecision(4);
	int work=100000;
	double max_time=0;
	bool speed_only=0;
	for(int i=1;i<=work;i++)
	{
		MakeTestCase();
		if(!speed_only) BruteForce();
		Start();
		Solve();
		Stop();
		if(!speed_only && !Compare())
		{
			Print();
			return;
		}
		max_time=max(max_time,d_time);
		cout<<i<<":OK, max time so far="<<max_time<<"\n";
	}
	cout<<":D\n";
}
int main()
{
	bool test=0;
	if(test) Test();
	else Run();
	return 0;
}