#include<iostream>


using namespace std;

typedef long long ll;

ll deset(ll x)
{
    if(x==0)return 1;
    ll i=1;
    while(i<=x)
    {
        i*=10;
    }
    return i/10;

}






int main()
{
    ll a,b,c;
    cin>>a>>b>>c;
    ll pa=a,pb=b,pc=c;
    ll sta=deset(pa),stb=deset(pb),stc=deset(pc);
    ll md=sta;
    if(md<stb)md=stb;
    if(md<stc)md=stc;
    ll A=a, B=b, C=c;

    ll bra=sta, brb=stb, brc=stc;

    while(A<10*md)
    {
        A=A*10+(a/deset(a));
        bra/=10;
        if(bra>0)a%=deset(a);
        else bra=sta, a=pa;


    }
    while(B<10*md)
    {
        B=B*10+(b/deset(b));
        brb/=10;
        if(brb>0)b%=deset(b);
        else brb=stb, b=pb;


    }
    while(C<10*md)
    {
        C=C*10+(c/deset(c));
        brc/=10;
        if(brc>0)c%=deset(c);

        else brc=stc, c=pc;


    }
   //cout<<A<<" "<<B<<" "<<C<<" ";
    if(A>=B&&A>=C)
    {
        cout<<pa;
        if(B>=C)cout<<pb<<pc;
        else cout<<pc<<pb;
    }
    else if(B>=A&&B>=C)
    {
        cout<<pb;
        if(A>=C)cout<<pa<<pc;
        else cout<<pc<<pa;
    }
    else if(C>=A&&C>=B)
    {
        cout<<pc;
        if(A>=B)cout<<pa<<pb;
        else cout<<pb<<pa;
    }

}