#include <iostream>
#include <deque>

using namespace std;

int main(void)
{
    ios::sync_with_stdio(false);

    unsigned long long a, b, c;
    deque<int> A, B, C;

    cin >> a >> b >> c;
    int aa = a, bb = b, cc = c;

    if( a == b && b == c )
    {
        cout << a << b << c << endl;
        return 0;
    }

    while( aa > 0 )
    {
        A.push_front( aa % 10 );
        aa /= 10;
    }

    while( bb > 0 )
    {
        B.push_front( bb % 10 );
        bb /= 10;
    }

    while( cc > 0 )
    {
        C.push_front( cc % 10 );
        cc /= 10;
    }

    int x, y, z;

    while(1)
    {
        x = A.front();
        y = B.front();
        z = C.front();

        if( x > y && x > z )
        {
            cout << a;
            if( b == c )
            {
                cout << b << c << endl;
                return 0;
            }
            while(1)
            {
                y = B.front();
                z = C.front();
                if( y > z )
                {
                    cout << b << c << endl;
                    return 0;
                }
                if( z > y )
                {
                    cout << c << b << endl;
                    return 0;
                }
                B.pop_front();
                C.pop_front();
            }
        }
        if( y > x && y > z )
        {
            cout << b;
            if( a == c )
            {
                cout << a << c << endl;
                return 0;
            }
            while(1)
            {
                x = A.front();
                z = C.front();
                if( x > z )
                {
                    cout << a << c << endl;
                    return 0;
                }
                if( z > x )
                {
                    cout << c << a << endl;
                    return 0;
                }
                A.pop_front();
                C.pop_front();
            }
        }
        if( z > y && z > x )
        {
            cout << c;
            if( b == a )
            {
                cout << b << a << endl;
                return 0;
            }
            while(1)
            {
                x = A.front();
                y = B.front();
                if( y > x )
                {
                    cout << b << a << endl;
                    return 0;
                }
                if( x > y )
                {
                    cout << a << b << endl;
                    return 0;
                }
                A.pop_front();
                B.pop_front();
            }
        }
        A.pop_front();
        B.pop_front();
        C.pop_front();
    }
}