#include <bits/stdc++.h>

using namespace std;

vector<unsigned long long> a;
vector<unsigned long long> b;
vector<unsigned long long> c;
unsigned long long A,B,C;

void ispisA()
{
	for(int i = (a.size()-1);i >= 0;i--)
	{
		cout<<a[i];
	
	}
	a.erase(a.begin(),a.end());
}

void ispisB()
{
	for(int i = (b.size()-1);i >= 0;i--)
	{
		cout<<b[i];
	
	}
	b.erase(b.begin(),b.end());
}

void ispisC()
{
	for(int i = (c.size()-1);i >= 0;i--)
	{
		cout<<c[i];
	
	}
	c.erase(c.begin(),c.end());	
}

void generisiVektore(unsigned long long A, unsigned long long B, unsigned long long C)
{
	while(A>0)
	{
		a.push_back (A%10);
		A=A/10;
	}
	while(B>0)
	{
		b.push_back (B%10);
		B=B/10;
	}
	while(C>0)
	{
		c.push_back (C%10);
		C=C/10;
	}
}



int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	unsigned long long r = 0;
	unsigned long long r1 = 0;
	cin>>A>>B>>C;
	unsigned long long i = 0;
	generisiVektore(A,B,C);  




	unsigned long long k,l,m;
	k = 0;
	l = 0;
	m = 0;
	unsigned long long z;
	unsigned long long d = max(a.size(),max(b.size(),c.size()));
	if(A==B && B==C)
	{
		ispisA();
		ispisB();
		ispisC();
		return 0;
	}
	while(i<d)
	{
		if(((a[i-k*a.size()] == b[i-l*b.size()] && a[i-k*a.size()] > c[i-m*c.size()]  )|| (c[i-m*c.size()] == b[i-l*b.size() && c[i-m*c.size()] > a[i-k*a.size()]]))|| (a[i-k*a.size()] == c[i-m*c.size()] && a[i-k*a.size()] > b[i-l*b.size()]))
		{
			i++;
		}else
		{
			unsigned long long zx = max(a[i-k*a.size()],max(b[i-l*b.size()],c[i-m*c.size()]));
			if(a[i-k*a.size()]==zx)
			{
				z=A;
				ispisA();
				i += d;
			}
			if(b[i-l*b.size()]==zx)
			{
				z=B;
				ispisB();
				i += d;
			}
			if(c[i-m*c.size()]==zx)
			{
				z=C;
				ispisC();
				i += d;
			}
		}
		if(i>(k+1)*a.size())
		{
			k++;
		}
		if(i>(l+1)*b.size())
		{
			l++;
		}
		if(i>(m+1)*c.size())
		{
			m++;
		}
		;
	}
	k = 0;
	l = 0;
	m = 0;
	unsigned long long z1;
	r += z;
	unsigned long long d1 = max(a.size(),max(b.size(),c.size()));
	i=0;
	if(a.size() == 0)
	{
		if(C==B){
			i += d1;
			z1 = B;
			ispisB();
		}
		while(i<d1)
		{
			if(c[i-m*c.size()] == b[i-l*b.size()])
			{
				i++;
			}else
			{
				unsigned long long zx = max(b[i-l*b.size()],c[i-m*c.size()]);
				if(b[i-l*b.size()]==zx)
				{
					z1=B;
					ispisB();
					i += d;
				}
				if(c[i-m*c.size()]==zx)
				{
					z1=C;
					ispisC();
					i += d;
				}
			}
			if(i>(l+1)*b.size())
			{
				l++;
			}
			if(i>(m+1)*c.size())
			{
				m++;
			}
		}
	}
	else if(b.size() == 0)
	{
		if(A==C){
			z1=C;
			ispisC();
			i += d;
		}
		while(i<d1)
		{
			if(c[i-m*c.size()] == a[i-k*a.size()])
			{
				i++;
			}else
			{
				unsigned long long zx = max(a[i-k*a.size()],c[i-m*c.size()]);
				if(a[i-k*a.size()]==zx)
				{
					z1=A;
					ispisA;
					i += d;
				}
				if(c[i-m*c.size()]==zx)
				{
					z1=C;
					ispisC();
					i += d;
				}
			}
			if(i>(k+1)*a.size())
			{
				k++;
			}
			if(i>(m+1)*c.size())
			{
				m++;
			}
		}
	}
	else
	{
		if(A==B)
		{
			i += d1;
			z1 = B;
			ispisB();
		}
		while(i<d1)
		{
			if(a[i-k*a.size()] == b[i-l*b.size()])
			{
				i++;
			}else
			{
				unsigned long long zx = max(b[i-l*b.size()],a[i-k*a.size()]);
				if(b[i-l*b.size()]==zx)
				{
					z1=B;
					ispisB();
					i += d;
				}
				if(a[i-k*a.size()]==zx)
				{
					z1=A;
					ispisC();
					i += d;
				}
			}
			if(i>(l+1)*b.size())
			{
				l++;
			}
			if(i>(k+1)*a.size())
			{
				k++;
			}
		}
	}
	
	r1 += z1;
	r += r1;
	if(a.size()>b.size())
	{
		ispisA();
	}
	if(b.size()>a.size())
	{
		ispisB();
	}
	if(c.size()>b.size())
	{
		ispisC();
	}
}