#include <iostream>
#include <string>

using namespace std;

int main()
{
    string a="";
    string b="";
    string c="";
    cin>>a;
    cin>>b;
    cin>>c;
    string s="";
    bool a2=true;
    bool b2=true;
    bool c2=true;
    int k=max(max(a.length(),b.length()),c.length());
    for(int i=0;i<k;i++){
        int a1=-1;
        int b1=-1;
        int c1=-1;
        if(i<a.length() && a2) a1=stoi(a.substr(i,1));
        if(i<b.length() && b2) b1=stoi(b.substr(i,1));
        if(i<c.length() && c2) c1=stoi(c.substr(i,1));
        if(a1>b1 && a1>c1){
            s+=a;
            a2=false;
        }
        if(b1>a1 && b1>c1){
            s+=b;
            b2=false;
        }
        if(c1>a1 && c1>b1){
            s+=c;
            c2=false;
        }

    }
    if(a2)s+=a;
    if(b2)s+=b;
    if(c2)s+=c;
    cout<<s;
}