#include<iostream>

using namespace std;
string a,b,c;
int broj;
string br1,br2,br3;
bool T1=true,T2=true,T3=true;
int main(){
    cin>>a>>b>>c;
    if(a.size()>=b.size()and a.size()>=c.size())broj=a.size();
    if(b.size()>=a.size()and b.size()>=c.size())broj=b.size();
    if(c.size()>=b.size()and c.size()>=a.size())broj=c.size();
    //za prvi broj
    for(int i=0;i<broj;i++){
        if(a[i]>b[i] and a[i]>c[i]){br1=a;T1=false;break;}
        if(b[i]>a[i] and b[i]>c[i]){br1=b;T2=false;break;}
        if(c[i]>b[i] and c[i]>a[i]){br1=c;T3=false;break;}
    }
    if(T1==true and T2==true and T3==true){
        cout<<a<<b<<c<<endl;
        return 0;
    }
    if(br1==a){
       for(int i=0;i<broj;i++){
        if(b[i]>a[i] and b[i]>c[i]){br2=b;T2=false;break;}
        if(c[i]>b[i] and c[i]>a[i]){br2=c;T3=false;break;}
        }
        if(T2==true and T3==true){
            cout<<a<<b<<c<<endl;
            return 0;
        }
    }
    if(br1==b){
        for(int i=0;i<broj;i++){
        if(a[i]>b[i] and a[i]>c[i]){br2=a;T1=false;break;}
        if(c[i]>b[i] and c[i]>a[i]){br2=c;T3=false;break;}
    }
        if(T1==true and T3==true){
            cout<<b<<a<<c<<endl;
            return 0;
        }
    }
    if(br1==c){
        for(int i=0;i<broj;i++){
        if(a[i]>b[i] and a[i]>c[i]){br2=a;T1=false;break;}
        if(b[i]>a[i] and b[i]>c[i]){br2=b;T2=false;break;}
        }
        if(T1==true and T2==true){
            cout<<c<<a<<b<<endl;
            return 0;
        }
    }
    if(br1==a and br2==b)br3=c;
    if(br1==a and br2==c)br3=b;
    if(br1==b and br2==a)br3=c;
    if(br1==b and br2==c)br3=a;
    if(br1==c and br2==a)br3=b;
    if(br1==c and br2==b)br3=a;
    cout<<br1<<br2<<br3<<endl;

return 0;
}