#include <iostream>

using namespace std;

int main()
{
    string a, b, c;
    cin>>a>>b>>c;
    
    string x = a+b+c;
    string y = a+c+b;
    string z = b+a+c;
    string r = b+c+a;
    string p = c+a+b;
    string q = c+b+a;
    
    bool nasao = false;
    int i = 0;
    
    while(!nasao)
    {
        if(x[i] > y[i] && x[i] > z[i] && x[i] > r[i] && x[i] > p[i] && x[i] > q[i])
        {
            cout<<x;
            nasao = true;
        }
    else if(y[i] > x[i] && y[i] > z[i] && y[i] > r[i] && y[i] > p[i] && y[i] > q[i]) 
        {
            cout<<y;
            nasao = true;
        }
    else if(z[i] > x[i] && z[i] > y[i] && z[i] > r[i] && z[i] > p[i] && z[i] > q[i]) 
        {
            cout<<z;
            nasao = true;
        }
    else if(r[i] > x[i] && r[i] > y[i] && r[i] > z[i] && r[i] > p[i] && r[i] > q[i]) 
        {
            cout<<r;
            nasao = true;
        }
    else if(p[i] > x[i] && p[i] > y[i] && p[i] > z[i] && p[i] > r[i] && r[i] > q[i]) 
        {
            cout<<p;
            nasao = true;
        }
    else if(q[i] > x[i] && q[i] > y[i] && q[i] > z[i] && q[i] > r[i] && q[i] > p[i]) 
        {
            cout<<q;
            nasao = true;
        }
        i++;
    }
    
    return 0;
}