#include <iostream>
#include <sstream>

using namespace std;

void fillNum(int [], int);
void reverseArray(int []);
int maxOf(int [], int, int[], int, int);
int minOf(int [], int, int[], int, int);

int countt = 0, tmpcount;
int main()
{
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);

    int aa[10], ba[10], ca[10];
    fillNum(aa, a);
    reverseArray(aa);
    fillNum(ba, b);
    reverseArray(ba);
    fillNum(ca, c);
    reverseArray(ca);

    int n1 = maxOf(aa, a, ba, b, 0);
    int n1a[10];
    fillNum(n1a, n1);
    reverseArray(n1a);
    int f1 = maxOf(n1a, n1, ca, c, 0);

    int n2 = minOf(aa, a, ba, b, 0);
    int n2a[10];
    fillNum(n2a, n2);
    reverseArray(n2a);
    int f2 = minOf(n1a, n1, ca, c, 0);

    int n3 = minOf(aa, a, ba, b, 0);
    int n3a[10];
    fillNum(n3a, n3);
    reverseArray(n3a);
    int n4 = minOf(ba, b, ca, c, 0);
    int n4a[10];
    fillNum(n4a, n4);
    reverseArray(n4a);
    int f3 = maxOf(n3a, n3, n4a, n4, 0);

    stringstream ss;
    ss << f1;
    string as = ss.str();
    stringstream ss1;
    ss1 << f3;
    string bs = ss1.str();
    stringstream ss2;
    ss2 << f2;
    string  cs = ss2.str();

    string f =  as + bs + cs;
    stringstream fina(f);
    int fI = 0;
    fina >> fI;

    printf("%d", fI);
}

void fillNum(int v[], int a){
    int i = 0;
    while(a > 0){
        v[i] = a % 10;
        a /= 10;
        countt++;
        i++;
    }
    while(i < 10){
        v[i] = 0;
        i++;
    }
}
void reverseArray(int v[]){
    for(int i = 0, j = countt-1; i <= j; i++, j--){
       int tmp = v[i];
       v[i] = v[j];
       v[j] = tmp;
    }
    tmpcount = countt;
    countt = 0;
}

int maxOf(int aa[], int a, int ba[], int b, int i){
    if(aa[i] > ba[i])
        return a;
    else if(aa[i] < ba[i])
        return b;
    else
        maxOf(aa, a, ba, b, i+1);
}
int minOf(int aa[], int a, int ba[], int b, int i){
    if(aa[i] < ba[i])
        return a;
    else if(aa[i] > ba[i])
        return b;
    else
        minOf(aa, a, ba, b, i+1);
}