#include <bits/stdc++.h>

using namespace std;

int main ()
{
    string a, b, c;
    cin >> a >> b >> c;
    string x, y, z, d, e, f;
    x=a+b+c; y=a+c+b; z=b+a+c; d=b+c+a; e=c+a+b; f=c+b+a;
    cout << max(max(x,max(y,z)),max(d,max(e,f))) << endl;
    return 0;
}