#include <iostream>

using namespace std;

string a, b, c, cur;

string n1, n2, n3;

int comparison(string x, string y){
	cout << "begin x: " << x << " y: " << y;
	int comp_len = 0, comp = 0;
	comp_len = min(x.length(), y.length());
	cout << " comp_len: " << comp_len << "\n";
	while(x[comp] >= y[comp]){
		cout << "comp: " << comp << " x[comp]: " << x[comp] << " y[comp]: " << y[comp] << "\n";
		comp++;
		if(comp >= comp_len){
			cout << "x.length(): " << x.length() << " y.length(): " << y.length() << " end\n";
			if(x.length() == y.length() || (x.length() < y.length() && x[comp-1] > y[comp-1])) return 1;
			else return 2;
		}
	}
	cout << " end2.\n";
	return 2;
}
int comparisons(string x, string y){
	//cout << "begin x: " << x << " y: " << y;
	int comp_len = 0, comp = 0;
	comp_len = min(x.length(), y.length());
	//cout << " comp_len: " << comp_len << "\n";
	while(x[comp] >= y[comp]){
		//cout << "comp: " << comp << " x[comp]: " << x[comp] << " y[comp]: " << y[comp] << "\n";
		comp++;
		if(comp == comp_len){
			//cout << "x.length(): " << x.length() << " y.length(): " << y.length() << " end\n";
			if(x.length() == y.length() || (x.length() < y.length() && x[comp-1] > y[comp-1])) return 1;
			else return 2;
		}
	}
	//cout << " end2.\n";
	return 2;
}
int main(){
	cin >> a >> b >> c;
	if(a.length() > b.length()) swap(a, b);
	if(a.length() > c.length()) swap(a, c);
	if(b.length() > c.length()) swap(b, c);
	//cout << a << " " << b << " " << c << "\n";
	//cout << comparisons(a, b) << endl;
	if(comparisons(a, b) == 2) swap(a, b);
	//cout << comparisons(a, c) << endl;
	if(comparisons(a, c) == 2) swap(a, c);
	//cout << comparisons(c, b) << endl;
	if(comparisons(c, b) == 2) swap(c, b);
	cout << a << b << c;
	/*
	int comp_ab = comparison(a, b);
	int comp_ac = comparison(a, c);
	cout << comp_ab << " " << comp_ac << "\n";
	if(comp_ab == 1 && comp_ac == 1){
		n1 = a;
		if(comparison(b, c) == 1){n2 = b; n3 = c;}
		else{n2 = c; n3 = b;}
		cout << n1 << n2 << n3 << "\n";
		return 0;
	}
	if(comp_ab == 2 && comp_ac == 2){
		n3 = a;
		if(comparison(b, c) == 1){n1 = b; n2 = c;}
		else{n1 = c; n2 = b;}
		cout << n1 << n2 << n3 << "\n";
		return 0;
	}
	if(comp_ab == 1 && comp_ac == 2){
		n1 = c; n2 = a; n3 = b;
		cout << n1 << n2 << n3 << "\n";
		return 0;
	}
	if(comp_ab == 2 && comp_ac == 1){
		n1 = b; n2 = a; n3 = c;
		cout << n1 << n2 << n3 << "\n";
		return 0;
	}
	*/
}