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

using namespace std;

int main()
{
    string a,b,c, r1, r2, r3, r4, r5, r6;

    cin>>a>>b>>c;

    r1=a+b+c;
    r2=a+c+b;
    r3=b+a+c;
    r4=b+c+a;
    r5=c+a+b;
    r6=c+b+a;

    cout<<max({r1, r2, r3, r4, r5, r6});

    return 0;
}