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

using namespace std;

int main()
{
    string s1,s2,s3,b1,b2,b3,b4,b5,b6;
    cin >> s1 >> s2 >> s3;
    b1=s1+s2+s3;
    b2=s1+s3+s2;
    b3=s2+s1+s3;
    b4=s2+s3+s1;
    b5=s3+s1+s2;
    b6=s3+s2+s1;
    cout << max(max(max(b1,b2),max(b3,b4)),max(b5,b6)) << endl;
    return 0;
}