#include<iostream>
#include<string>
#include<algorithm>
#include<vector>

using namespace std;

int pomozi(string a, string b) 
{ 
    string ab = a.append(b), ba = b.append(a);  
    return ab.compare(ba) > 0 ? 1: 0; 
} 

int main()
{
	vector<string> v(3);
	cin >> v[0] >> v[1] >> v[2];
	sort(v.begin(), v.end(), pomozi);
	for (int i=0; i < v.size() ; i++ ) 
        cout << v[i];
	return 0;
}