#include <bits/stdc++.h>

using namespace std;

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

void generisiVektore(int A, int B, int 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 boljibroj(int i)

int main()
{
	int r = 0;
	int r1 = 0;
	cin>>A>>B>>C;
	int i = 0;
	generisiVektore(A,B,C);
	int k,l,m;
	k = 0;
	l = 0;
	m = 0;
	int z;
	int d = max(a.size(),max(b.size(),c.size()));
	while(i<d)
	{
		if((a[i-k*a.size()] == b[i-l*b.size()] || c[i-m*c.size()] == b[i-l*b.size()])|| a[i-k*a.size()] == c[i-m*c.size()])
		{
			i++;
		}else
		{
			int 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.empty();
			}
			if(b[i-l*b.size()]==zx)
			{
				z=B;
				b.empty();
			}
			if(c[i-m*c.size()]==zx)
			{
				z=C;
				c.empty();
			}
		}
		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;
	int z1;
	r += z;
	int d1 = max(a.size(),max(b.size(),c.size()));
	for(int j = 0;j<(a.size() + b.size() +c.size());j++)
	{
		r *= 10;
	}
	i=0;
	while(i<d1)
	{
		if((a[i-k*a.size()] == b[i-l*b.size()] || c[i-m*c.size()] == b[i-l*b.size()])|| a[i-k*a.size()] == c[i-m*c.size()])
		{
			i++;
		}else
		{
			int 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)
			{
				z1=A;
			}
			if(b[i-l*b.size()]==zx)
			{
				z1=B;
			}
			if(c[i-m*c.size()]==zx)
			{
				z1=C;
			}
		}
		if(i>(k+1)*a.size())
		{
			k++;
		}
		if(i>(l+1)*b.size())
		{
			l++;
		}
		if(i>(m+1)*c.size())
		{
			m++;
		}
	}
	r1 += z1;
	for(int 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;
}