#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string a,b,c,br,br1,br2,t;
int r,o,k,l,m,n;
int main (){
cin>>a>>b>>c;
br="0";
br1="0";
br2="0";
m=br1.size();
n=br2.size();
l=br.size();
o=a.size();
r=b.size();
k=c.size();
for(int i=0;i<o;i++){
        for(int j=0;j<l;j++)
    if(a[i]>=br[j]){
        br=a[i];
    }

for(int i=0;i<r;i++){
        for(int j=0;j<m;j++)
    if(b[i]>=br1[j]){
        br1=b[i];
    }

for(int i=0;i<k;i++){
        for(int j=0;j<l;j++)
    if(c[i]>=br2[j]){
        br2=c[i];
    }
   }
}
}
    if(br>=br1 and br>=br2 and br2>=br1){
        t=t+a+c+b;
cout<<t;
return 0;
    }
    if(br>=br1 and br>=br2 and br1>=br2){
        t=t+a+b+c;
cout<<t;
return 0;
    }
if(br1>=br and br1>=br2 and br2>=br){
        t=t+b+c+a;
cout<<t;
return 0;
    }
if(br1>=br and br1>=br2 and br>=br2){
        t=t+b+a+c;
cout<<t;
return 0;
    }
    if(br2>=br and br2>=br1 and br1>=br){
        t=t+c+b+a;
cout<<t;
return 0;
    }
if(br2>=br and br2>=br1 and br>=br1){
        t=t+c+b+a;
cout<<t;
return 0;
    }
return 0;

}