#include <bits/stdc++.h>

using namespace std;

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

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)
	{
		r1 = A;
		r = A;
		b.erase(b.begin(),b.end());
		for(unsigned long long j = 0;j<(a.size() + b.size() +c.size());j++)
		{
			r1 *= 10;
			
		}
		a.erase(a.begin(),a.end());
		for(unsigned long long j = 0;j<(a.size() + b.size() +c.size());j++)
		{
			r *= 10;
			
		}
		r1 = r1 + r + A;
		cout<<r1;
		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;
				a.erase(a.begin(),a.end());
				i += d;
			}
			if(b[i-l*b.size()]==zx)
			{
				z=B;
				b.erase(b.begin(),b.end());
				i += d;
			}
			if(c[i-m*c.size()]==zx)
			{
				z=C;
				c.erase(c.begin(),c.end());
				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()));
	for(unsigned long long j = 0;j<(a.size() + b.size() +c.size());j++)
	{
		r *= 10;
	}
	i=0;
	if(a.size() == 0)
	{
		if(C==B){
			i += d1;
			z1 = B;
			b.erase(b.begin(),b.end());
		}
		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;
					b.erase(b.begin(),b.end());
					i += d;
				}
				if(c[i-m*c.size()]==zx)
				{
					z1=C;
					c.erase(c.begin(),c.end());
					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;
			c.erase(c.begin(),c.end());
			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;
					a.erase(a.begin(),a.end());
					i += d;
				}
				if(c[i-m*c.size()]==zx)
				{
					z1=C;
					c.erase(c.begin(),c.end());
					i += d;
				}
			}
			if(i>(k+1)*a.size())
			{
				k++;
			}
			if(i>(m+1)*c.size())
			{
				m++;
			}
		}
	}
	else
	{
		if(A==B)
		{
			i += d1;
			z1 = B;
			b.erase(b.begin(),b.end());
		}
		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;
					b.erase(b.begin(),b.end());
					i += d;
				}
				if(a[i-k*a.size()]==zx)
				{
					z1=A;
					a.erase(a.begin(),a.end());
					i += d;
				}
			}
			if(i>(l+1)*b.size())
			{
				l++;
			}
			if(i>(k+1)*a.size())
			{
				k++;
			}
		}
	}
	
	r1 += z1;
	for(unsigned long long j = 0;j<(a.size() + b.size() +c.size());j++)
	{
		r1 *= 10;
	}
	r += r1;
	if(a.size()>b.size())
	{
		r += A;
	}
	if(b.size()>a.size())
	{
		r += B;
	}
	if(c.size()>b.size())
	{
		r += C;
	}
	cout<<r<<endl;
	
}