#include<stdio.h>
#include<list>
#include<iostream>
using std::cout;
using std::cin;
using std::list;
main()
{
	unsigned long long a,b,c,p,d,t;
	list<int> cifrea,cifreb,cifrec,max;
	cin>>a>>b>>c;
	p=a;
	d=b;
	t=c;
	while (a)
    {
        int cifra = a % 10;
        cifrea.push_front(cifra);
        a /= 10;
    }
    while (b)
    {
        int cifra = b % 10;
        cifreb.push_front(cifra);
        b /= 10;
    }
    while (c)
    {
        int cifra = c % 10;
        cifrec.push_front(cifra);
        c /= 10;
    }
    list<int>::iterator ia = cifrea.begin();
    list<int>::iterator ib = cifreb.begin();
    list<int>::iterator ic = cifrec.begin();
    if(cifrea.size()>cifreb.size())
    {
    	if(cifrea.size()>cifrec.size())
    	{
    		max=cifrea;
    	}
    	else if(cifrea.size()==cifrec.size())
    	{
    		max=cifrec;
		}
	}
	if(cifreb.size()>cifrea.size())
    {
    	if(cifreb.size()>cifrec.size())
    	{
    	max=cifreb;
    	}
    	else if(cifreb.size()==cifrec.size())
    	{
    	max=cifrec;
		}
	}
	if(cifrec.size()>cifreb.size())
    {
    	if(cifrec.size()>cifrea.size())
    	{
    	max=cifrec;
    	}
    	else if(cifrec.size()==cifrea.size())
    	{
    	max=cifrea;
		}
	}
	list<int>::iterator im = max.begin();
	a=0;
	b=0;
	c=0;
    while(im != max.end())
    {
    	if(ia==cifrea.end())
		{
			    a=0;
		}
		else
		{
			a=*ia;	
		}
		if(ib==cifreb.end())
		{
			    b=0;
		}
		else
		{
			b=*ib;	
		}
		if(ic==cifrec.end())
		{
			    c=0;
		}
		else
		{
			c=*ic;	
		}
		if(a > b && a > c)
			{
				if(b>c)
				{
					cout<<p<<d<<t;
			    	break;
				}
				else if(b < c)
				{
					cout<<p<<t<<d;
			    	break;
				}
				else
				{
					cout<<p;
			    	ia=cifrea.end();
					ib++;
					ic++;
				}
			}
		else if (b > a && b > c)
		    {
		    	if(a > c)
		    	{
			    	cout<<d<<p<<t;
					break;	
				}
				else if(a<c)
				{	
					cout<<d<<t<<p;
			    	break;
				}
				else
				{
					cout<<d<<p<<t;
					break;
			    	
				}
			}
		else if (c > a && c > b)
		    {
		    	if(a > b)
		    	{
		    		cout<<t<<p<<d;
					break;	
				}
				else if(a < b)
				{
					cout<<t<<d<<p;
			    	break;
				}
				else
				{
					cout<<t;
			    	ic=cifrec.end();
					ia++;
					ib++;
				}
			}
		else if(a==b && b==c && c==a)
		    {
		    	ia++;
		    	ib++;
		    	ic++;
		    	im++;
			}
		}
	}