#include<iostream>
#include <sstream> 
using namespace std;
int main()
{
	string a,b,c;
	int br=0;
	cin>>a>>b>>c;
	if(a!=b)
	while(true)
	{
		int a1,b1;
		a1=(int)a[br];
		b1=(int)b[br];
		if(a1>b1)
		{
			break;
		}
		else
		if(a1<b1)
		{
			string t;
			t=a;
			a=b;
			b=t;
			break;
		}
		else
		{
			if(a.length()<br+1)
			{
				string t;
			t=a;
			a=b;
			b=t;
			break;
			}
			if(b.length()<br+1)
			{
				break;
			}
		}
		br++;
	}
	br=0;
	if(b!=c)
	while(true)
	{
		int b1=(int)b[br],c1=(int)c[br];
		if(b1>c1)
		{
			break;
		}
		else
		if(b1<c1)
		{
			string t;
			t=b;
			b=c;
			c=t;
			break;
		}
		else
		{
			if(b.length()<br+1)
			{
			string t;
			t=b;
			b=c;
			c=t;
			break;
			}
			if(c.length()<br+1)
			{
				break;
			}
		}
		br++;
	}
	br=0;
	if(a!=c)
	while(true)
	{
		int a1=(int)a[br],c1=(int)c[br];

		if(a1>c1)
		{
			break;
		}
		else
		if(a1<c1)
		{
			string t;
			t=a;
			a=c;
			c=t;
			break;
		}
		else
		{
			if(a.length()<br+1)
			{
			string t;
			t=a;
			a=c;
			c=t;
			break;
			}
			if(c.length()<br+1)
			{
				break;
			}
		}
		br++;
	}	
	cout<<a+b+c;
	return 0;
}