#include <bits/stdc++.h>

using namespace std;

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

int main()
{
    string a,b,c;
    cin >> a >> b >> c;
    vector<string> s(6);
    s[0]=a+b+c;
    s[1]=a+c+b;
    s[2]=b+a+c;
    s[3]=b+c+a;
    s[4]=c+a+b;
    s[5]=c+b+a;
    sort(s.begin(),s.end(),cmp);
    cout << s[0];
    return 0;
}