#include <bits/stdc++.h>
using namespace std;

string a,b,c;
string abc,acb,bac,bca,cab,cba;
string tmp;

bool bigger(string x, string y)
{
    for(int i=0; i<x.length(); )
    {
        if(x[i]>y[i])
            return true;
        if(x[i]==y[i])
            i++;
        if(x[i]<y[i])
            return false;
    }
}

int main()
{
    cin>>a>>b>>c;
    abc=a+b+c;
    acb=a+c+b;
    bac=b+a+c;
    bca=b+c+a;
    cab=c+a+b;
    cba=c+b+a;
    tmp=abc;
    if(bigger(acb,tmp))
        tmp=acb;
    if(bigger(bac,tmp))
        tmp=bac;
    if(bigger(bca,tmp))
        tmp=bca;
    if(bigger(cab,tmp))
        tmp=cab;
    if(bigger(cba,tmp))
        tmp=cba;
    cout<<tmp;
    return 0;
}