#include <bits/stdc++.h>
using namespace std;
vector <long long>a;
vector <long long>b;
vector <long long>c;
long long i,j;
long long niz[3];
void rastavi(long long br,char ch)
{
    switch(ch)
    {
    case 'A':
        while(br!=0){
            a.push_back(br%10);
            br/=10;
        }
        break;
    case 'B':
        while(br!=0){
            b.push_back(br%10);
            br/=10;
        }
        break;
    case 'C':
        while(br!=0){
            c.push_back(br%10);
            br/=10;
        }
        break;
    }
}
void uporedi(vector<long long>x,vector<long long> y,vector<long long>z)
{
    long long br=1;
    while(true){
            if(x[x.size()-br]<y[y.size()-br]){swap(niz[0],niz[1]); break;}else if(x[x.size()-br]>y[y.size()-br])break;else{
        br++;
        if(y.size()-br<0)break;
        if(x.size()-br<0){swap(niz[0],niz[1]);break;}}
    }//cout<<niz[0]<<niz[1]<<niz[2];
    br=1;
    while(true){
            if(x[x.size()-br]<z[z.size()-br]){swap(niz[0],niz[2]); break;}else if(x[x.size()-br]<z[z.size()-br])break;else{
        br++;
        if(z.size()-br<0)break;
        if(x.size()-br<0){swap(niz[0],niz[2]);break;}}
    }//cout<<niz[0]<<niz[1]<<niz[2];
    br=1;
    while(true){
            if(z[z.size()-br]>y[y.size()-br]){swap(niz[1],niz[2]); break;}if(z[z.size()-br]<y[y.size()-br])break; else {
        br++;
        if(z.size()-br<0)break;
        if(y.size()-br<0){swap(niz[1],niz[2]);break;} }
    }//cout<<niz[0]<<niz[1]<<niz[2];
}
int main()
{
    long long A,B,C;
    cin>>A>>B>>C;
    niz[0]=A;
    niz[1]=B;
    niz[2]=C;
    rastavi(A,'A');
    rastavi(B,'B');
    rastavi(C,'C');
    uporedi(a,b,c);
    cout<<niz[0]<<niz[1]<<niz[2];
}