#include <iostream>
#include <string>
#include <sstream>


using namespace std;

string a;
string b;
string c;
long long ab,ac,bc,a1,b1,c1,mx1,mx2,mx3,mx4,mx5;
int main () {
cin>>a>>b>>c;
a1=a.length();
b1=b.length();
c1=c.length();
mx1=max(a1,b1);
mx2=max(mx1,c1);
for (int i=0;i<mx2;i++) {


if (a[i]>b[i]) {
ab=1;
break; }
if (b[i]>a[i]) {
ab=2;
break; }
}


for (int i=0;i<mx2;i++) {
if (a[i]>c[i]) {
ac=1;
break; }
if (c[i]>a[i]) {
ac=2;
break; }
}


for (int i=0;i<mx2;i++) {
if (b[i]>c[i]) {
bc=1;
break; }
if (c[i]>b[i]) {
bc=2;
break; }
}


if (ab==1&&bc==1)
cout<<a<<b<<c;

if (ac==1&&bc==2)
cout<<a<<c<<b;

if (ab==2&&ac==1)
cout<<b<<a<<c;

if (bc==1&&ac==2)
cout<<b<<c<<a;

if (ac==2&&ab==1)
cout<<c<<a<<b;

if (bc==2&&ab==2)
cout<<c<<b<<a;










if (ab==0&&bc==0&&ac==0) {
    cout<<a<<b<<c;
}

if (ab!=0&&bc==0&&ac!=0){
    if(ab==1)
        cout<<a<<b<<c;
    else
        cout<<b<<c<<a;

}

if (ab==0&&bc!=0&&ac!=0){
    if(ac==1)
        cout<<a<<b<<c;
    else
        cout<<c<<b<<a;

}

if (ac==0&&bc!=0&&ab!=0){
    if(ab==1)
        cout<<a<<c<<b;
    else
        cout<<b<<c<<a;

}








return 0;
}