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

void swap(string *arr, int x, int y)
{
	string temp = arr[x];
	arr[x] = arr[y];
	arr[y] = temp;
}

void QuickSort(string *arr, int l, int d)
{
	if (l < d)
	{
		int k = l;
		for (int i = l + 1; i <= d; i++)
		{
			if (arr[i] <= arr[l])
			{
				k++;
				swap(arr, i, k);
			}
		}
		swap(arr, l, k);
		QuickSort(arr, l, k - 1);
		QuickSort(arr, k + 1, d);
	}
}

int main()
{
	string a, b, c;
	cin >> a >> b >> c;
	int n = 6;
	string* niz = new string[n];
	niz[0] = a + b + c;
	niz[1] = a + c + b;
	niz[2] = b + a + c;
	niz[3] = b + c + a;
	niz[4] = c + a + b;
	niz[5] = c + b + a;
	QuickSort(niz, 0, n - 1);
	cout << niz[n - 1];
	return 0;
}