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


string a,b,c;

string x,y,z,k,n,m;

int main()
{
    cin>>a>>b>>c;

    x=a+b+c;
    y=a+c+b;
    z=b+a+c;
    k=c+a+b;
    n=b+c+a;
    m=c+b+a;


    string ma=x;
    if(ma.compare(y)<0)ma=y;
    if(ma.compare(z)<0)ma=z;
    if(ma.compare(k)<0)ma=k;
    if(ma.compare(n)<0)ma=n;
    if(ma.compare(m)<0)ma=m;
    cout<<ma;


}