#include <bits/stdc++.h>

using namespace std;

int main()
{
    vector <string> s;
    string a,b,c;
    cin >> a >> b >> c;
    s.push_back(a),s.push_back(b),s.push_back(c);
    int x[3];
    x[0]=0,x[1]=1,x[2]=2;
    vector <string> all;
    do
    {
        string st = "";
        for(int i = 0; i < 3; i++)
        {
            st += s[x[i]];
        }
        all.push_back(st);
    }while(next_permutation(x,x+3));
    sort(all.begin(),all.end());
    cout << all[all.size()-1];
    return 0;
}