#include <iostream>
#include <string>
#include <cstdio>

using namespace std;
unsigned long long rev(unsigned long long n1);
int main()
{
    unsigned long long a,b,c, a1, b1, c1, strl = 0;
    string g;
    // a = 100; // test
    // b = 102;
    // c = 102;
    cin >> a >> b >> c;
    a1 = rev(a);
    b1 = rev(b);
    c1 = rev(c);
    while(1)
    {
        if(a1 > 0)
        {
            if(a1 % 10 > b1 % 10 && a1 % 10 > c1 % 10)
            {
                g+=::to_string(a);
                strl++;
                a1 = 0;
            }
        }
        if(c1 > 0)
        {
            if(c1 % 10 > a1 % 10 && c1 % 10 > b1 % 10)
            {
                g+=::to_string(c);
                strl++;
                c1 = 0;
            }
        }
        if(b1 > 0)
        {
            if(b1 % 10 > a1 % 10 && b1 % 10 > c1 % 10)
            {
                g+=::to_string(b);
                strl++;
                b1 = 0;
            }
            else if(b1 < 10 && a1 < 10 && c1 < 10 && (a1 == b1 || b1 == c1))
            {
                g+=::to_string(b);
                strl++;
                b1 = 0;
            }
        }

        if(strl == 3) break;
        if(a1/10 != 0)a1 /= 10;
        if(b1/10 != 0)b1 /= 10;
        if(c1/10 != 0)c1 /= 10;
    }
    cout << g << "\n";
    return 0;
}

unsigned long long rev(unsigned long long n1)
{
    unsigned long long n2 = 0;
    unsigned long long n3 = 1;
    while(n1 != 0)
    {
        if(n1%10 == 0) n3*=10;
        int rem = n1%10;
        n2 = n2 * 10 + rem;
        n1 /= 10;
    }
    if(n2 == 1) return n3;
    return n2;
}