#include <iostream>
#include <string>
using namespace std;

bool veci(string s, string t)
{
	int i = 0;
	while (s[i] && t[i] && s[i] == t[i])
		i++;
	int a = i % s.length();
	int b = i % t.length();

	return s[a] > t[b];
}

void swap(string *s, string *t)
{
	string temp = *s;
	*s = *t;
	*t = temp;
}

int main()
{
	string s[3];
	for (int i = 0; i < 3; i++)
		cin >> s[i];

	for (int i = 0; i < 2; i++)
		for (int j = i + 1; j < 3; j++)
			if (veci(s[j], s[i]))
				swap(s[i], s[j]);

	cout << s[0] + s[1] + s[2] << endl;

	return 0;
}