#include <bits/stdc++.h>

using namespace std;

string a,b,c;
vector<string> spajanja;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cerr.tie(0);
    
    cin >> a >> b >> c;
   
    spajanja.push_back(a+b+c);
    spajanja.push_back(a+c+b);
    spajanja.push_back(b+a+c);
    spajanja.push_back(b+c+a);
    spajanja.push_back(c+a+b);
    spajanja.push_back(c+b+a);
    
    sort(spajanja.begin(),spajanja.end());
    
    cout << spajanja[spajanja.size()-1];
   
    return 0;
}