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

using namespace std;

int compare(string x, string y)
{
	return (x+y).compare(y+x)>0 ? 1 : 0;
}

int main()
{
	string a, b, c, x;
	cin >> a;
	cin >> b;
	cin >> c;
	vector<string> vec;
	vec.push_back(a); vec.push_back(b); vec.push_back(c);
	sort(vec.begin(), vec.end(), compare);
	cout << vec[0] << vec[1] << vec[2];
	return 0;
}