#include<bits/stdc++.h>
#define pb push_back
#define pf push_front
#define fr first
#define sc second
#define FOR(i,x,y) for(int i=x; i<=y; i++)
using namespace std;
void cepi(bool k)
{
//	#ifndef ONLINE_JUDGE
//	if(k)freopen("input.txt", "r", stdin);
//	#endif
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.tie(nullptr);
}

vector<string>a;
string s,p,sol;
int main()
{
  cepi(0);
	FOR(i,1,3) {cin>>s;a.pb(s);}
	sort(a.begin(),a.end());
	for(auto itr:a) sol+=itr;
	do {
		p="";
		for(auto itr:a) p+=itr;
		if(p>sol)sol=p;
	} while(next_permutation(a.begin(),a.end()));
	cout<<sol;


	return 0;
}