#include <bits/stdc++.h>
using namespace std;
int main(){
    string a,b,c,result,d,e,f,g,h,i,j,k;
    getline (cin,a);
    getline (cin,b);
    getline (cin,c);
    d=a+b+c;
    e=a+c+b;
    f=b+a+c;
    g=b+c+a;
    h=c+a+b;
    i=c+b+a;

    if(d>e and d>f and d>g and d>h and d>i)
    cout<<d;
    else if(e>d and e>f and e>g and e>h and e>i)
        cout<<e;
    else if(f>d and f>e and f>g and f>h and f>i)
        cout<<f;
    else if(g>d and g>e and g>f and g>h and g>i)
        cout<<g;
    else if(h>d and h>e and h>f and h>g and h>i)
        cout<<h;
    else if(i>d and i>e and i>f and i>g and i>h)
        cout<<i;
    if(a==b and a<c and b<c)
        cout<<h;
        if(b==c and b<a and c<a)
            cout<<d;
         if(c==a and c<b and a<b)
            cout<<g;
if(a==b and a==c and b==c)
                cout<<d;
return 0;
}