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

using namespace std;

int main()
{
    string s,p,q,x,y,z,j,k,l,maks;
    cin>>s>>p>>q;
    x=s+p+q;
    y=s+q+p;
    z=p+q+s;
    j=p+s+q;
    k=q+p+s;
    l=q+s+p;
    maks=max({x,y,z,j,k,l});
    cout<<maks;
    return 0;
}