#include <bits/stdc++.h>
using namespace std;
string a,b,c,n1,n2,n3,n4,n5,n6,m1,m2,m3,r1;
int main () {
cin>>a>>b>>c;
n1=a+b+c;n2=a+c+b;n3=b+a+c;
n4=b+c+a;n5=c+a+b;n6=c+b+a;
m1=max(n1,n2);
m2=max(n3,n4);
m3=max(n5,n6);
r1=max(m1,m2);
if (r1>=m3){cout<<r1<<endl;}
else cout<<m3<<endl;
return 0;
}