#include<bits/stdc++.h>
using namespace std;

string poredi(string x, string y) {
    for(int i = 0; i < x.length(); ++i) {
        if(x[i] > y[i]) {
            return x;
        }
        else if(x[i] < y[i]) {
            return y;
        }
    }
    return x;
}
int main() {
    string a, b, c;
    cin >> a >> b >> c;

    string s1 = a + b + c;
    string s2 = a + c + b;
    string s3 = b + a + c;
    string s4 = b + c + a;
    string s5 = c + a + b;
    string s6 = c + b + a;

    if(s1 == "000") {
        cout << 0;
        return 0;
    }
    cout << poredi(poredi(poredi(poredi(poredi(s1, s2), s3), s4), s5), s6);
}