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

using namespace std;

bool cmp(string a, string b)
{
    if(a.length() != b.length())
    {
        return a.length() > b.length();
    }
    for(int i=0; i<a.length() && i<b.length(); i++)
    {
        if(a[i] != b[i])
        {
            return a[i] > b[i];
        }
    }
    return false;
}

int main()
{
    string a, b, c;
    cin >> a >> b >> c;
    string r[] = {a+b+c, a+c+b, b+a+c, b+c+a, c+a+b, c+b+a};
    sort(r, r+6, cmp);
    cout << r[0];
    return 0;
}