#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
    int a, b, c;
    int a1, b1, c1;
    static int niza[20]={0}, nizb[20]={0}, nizc[20]={0};
    
    cin >> a >> b >> c;
    a1 = a;
    b1 = b;
    c1 = c;
    
    for (int i=0; i<20; i++)
    {
        niza[i] = a1%10;
        a1/=10;
        nizb[i] = b1%10;
        b1/=10;
        nizc[i] = c1%10;
        c1/=10;
    }
    
    int pa=3, pb=3, pc=3;
    
    for (int i=0; i<20; i++)
    {
        if (niza[i]==nizb[i]&&niza[i]==nizc[i])
        {
            continue;   
        }
        //c
        if (niza[i]==nizb[i]&&niza[i]>nizc[i])
        {
            pc=3;
            for (int j=i+1; j<20; j++)
            {
                if (niza[j]<nizb[j])
                {
                    pb=1;
                    pa=2;
                    break;
                }
                if (niza[j]>nizb[j])
                {
                    pb=2;
                    pa=1;
                    break;
                }   
            }
            break;
        }
        if (niza[i]==nizb[i]&&niza[i]<nizc[i])
        {
            pc=1;
            for (int j=i+1; j<20; j++)
            {
                if (niza[j]<nizb[j])
                {
                    pb=2;
                    pa=3;
                    break;
                }
                if (niza[j]>nizb[j])
                {
                    pb=3;
                    pa=2;
                    break;
                }   
            }
            break;
        }
        //b
        if (niza[i]>nizb[i]&&niza[i]==nizc[i])
        {
            pb=3;
            for (int j=i+1; j<20; j++)
            {
                if (niza[j]<nizc[j])
                {
                    pc=1;
                    pa=2;
                    break;
                }
                if (niza[j]>nizc[j])
                {
                    pc=2;
                    pa=1;
                    break;
                }   
            }
            break;
        }
        if (niza[i]>nizb[i]&&niza[i]==nizc[i])
        {
            pb=1;
            for (int j=i+1; j<20; j++)
            {
                if (niza[j]<nizc[j])
                {
                    pc=2;
                    pa=3;
                    break;
                }
                if (niza[j]>nizc[j])
                {
                    pc=3;
                    pa=2;
                    break;
                }   
            }
            break;
        }
        //a
        if (niza[i]<nizb[i]&&nizb[i]==nizc[i])
        {
            pa=3;
            for (int j=i+1; j<20; j++)
            {
                if (nizc[j]<nizb[j])
                {
                    pb=1;
                    pc=2;
                    break;
                }
                if (nizc[j]>nizb[j])
                {
                    pb=2;
                    pc=1;
                    break;
                }   
            }
            break;
        }
        if (niza[i]>nizb[i]&&nizb[i]==nizc[i])
        {
            pa=1;
            for (int j=i+1; j<20; j++)
            {
                if (nizc[j]<nizb[j])
                {
                    pb=2;
                    pc=3;
                    break;
                }
                if (nizc[j]>nizb[j])
                {
                    pb=3;
                    pc=2;
                    break;
                }   
            }
            break;
        }
        if (niza[i]>nizb[i]&&nizb[i]>nizc[i])
        {
            pa = 1;
            pb = 2;
            pc = 3;    
            break;
        }
        if (nizb[i]>niza[i]&&niza[i]>nizc[i])
        {
            pa = 2;
            pb = 1;
            pc = 3;    
            break;
        }
        if (niza[i]>nizc[i]&&nizb[i]<nizc[i])
        {
            pa = 1;
            pb = 3;
            pc = 2;    
            break;
        }
        if (niza[i]<nizc[i]&&nizb[i]<niza[i])
        {
            pa = 2;
            pb = 3;
            pc = 1;    
            break;
        }
        if (niza[i]<nizc[i]&&nizb[i]>niza[i])
        {
            pa = 3;
            pb = 2;
            pc = 1;    
            break;
        }
        if (niza[i]<nizb[i]&&nizb[i]>nizc[i])
        {
            pa = 3;
            pb = 1;
            pc = 2;    
            break;
        }
    }
    
    if (pa<pb&&pa<pc)
    {
        if (pb>pc)
            printf("%d%d%d", a, c, b);
        else
            printf("%d%d%d", a, b, c);
    }
    if (pb<pa&&pb<pc)
    {
        if (pa>pc)
            printf("%d%d%d", b, c, a);
        else
            printf("%d%d%d", b, a, c);
    }
    if (pc<pa&&pc<pb)
    {
        if (pa>pb)
            printf("%d%d%d", c, b, a);
        else
            printf("%d%d%d", c, a, b);
    }
    
    return 0;
}