#include <iostream>
#include <math.h>
#include <string>

using namespace std;

int main()
{
    string A,B,C,N,bigger ("a"),smaller,bigger1 ("a"),smaller1,F,S,T;
    int ALength,BLength,CLength,i=0,big;
    cin >> A >> B >> C;
    ALength=A.length();
    BLength=B.length();
    CLength=C.length();

        while(bigger=="a")
        {
            if(A[i]>B[i])
            {
                bigger=A;
                smaller=B;
            }
            else
            if(A[i]<B[i])
            {
                bigger=B;
                smaller=A;
            }
            i++;
        }
        i=0;
        while(bigger1=="a")
        {
            if(C[i]>B[i])
            {
                bigger1=C;
                smaller1=B;
            }
            else
            if(C[i]<B[i])
            {
                bigger1=B;
                smaller1=C;
            }
            i++;
        }
    if(bigger>=bigger1)
        F=bigger;
    else
        F=bigger1;
    if(smaller<smaller1)
        T=smaller;
    else
        T=smaller1;

    int F1 = stoi(F);
    int S1;
    int T1 = stoi(T);
    int A1 = stoi(A);
    int B1 = stoi(B);
    int C1 = stoi(C);
    S1=A1+B1+C1-F1-T1;
    cout << F << S1 << T << endl;
    return 0;
}