#include <bits/stdc++.h> 
#define f first
#define s second
#define pb push_back
#define mp make_pair

using namespace std;
typedef pair<int, int> pi;
typedef long long ll;
typedef pair<ll, ll> pll;

string maxx = "";

bool veci(string a)
{
	if(maxx == "") return true;
	for(int i = 0; i < a.length(); i++)
		if(maxx[i] > a[i]) return false;
		else if(maxx[i] < a[i]) return true;
	return false;
}

int main()
{
	ios::sync_with_stdio(false);	
	cin.tie(0);	
	string niz[3];	
	for(int i = 0; i < 3; i++) cin >> niz[i];
	do
	{
		string str = niz[0] + niz[1] + niz[2];
		if(veci(str)) maxx = str;
 	}
	while(next_permutation(niz, niz+3));
	cout << maxx;
	return 0; 
}