#include <bits/stdc++.h>
using namespace std;

bool compareFunction(string s1, string s2) {
	string x = s1.append(s2);
	string y = s2.append(s1);
	
	return	x.compare(y) > 0 ? 1 : 0;
}

void print(vector<string> x) {
	for(int i = 0 ; i < x.size() ; i++)
		cout << x[i];	
}

int main() {
	vector<string> x(3);
	cin >> x[0];
	cin >> x[1];
	cin >> x[2];

	sort(x.begin(),x.end(),compareFunction);
	print(x);
}