#include <iostream>

using namespace std;

int main()
{
    string a, b,c;
    cin >> a >> b >> c;
    string a1 = a + b + c;
    string a2 = a + c + b;
    string b1 = b + a + c;
    string b2 = b + c + a;
    string c1 = c + a + b;
    string c2 = c + b + a;

    cout << max(max(max(a1, a2), max(b1,b2)),(max(c1,c2)));

    return 0;
}