#include<iostream>
#include<cmath>
#include<string>
#include<sstream>
using namespace std;
main()
{
long a,a2,b,b2,c,c2;
long s[10];
long max = 0;
long mnz = 0;
long br=3,br1 = 1,br2 = 1,br3 = 1;

cin>>a;
a2 = a;
cin>>b;
b2 = b;
cin>>c;
c2 = c;
while(a2 > 9)
{
	br++;
	br1++;
	a2/=10;
}
while(b2 > 9)
{
	br++;
	br2++;
	b2/=10;
}
while(c2 > 9)
{
	br++;
	br3++;
	c2/=10;
}
cout<<br1<<endl;
cout<<br2<<endl;
cout<<br3<<endl;
cout<<br<<endl;

s[1] = a*pow(10,br-br1)+b*pow(10,br-br1-br2)+c;
s[2] = a*pow(10,br-br1)+c*pow(10,br-br1-br3)+b;
s[3] = b*pow(10,br-br2)+a*pow(10,br-br1-br2)+c;
s[4] = b*pow(10,br-br2)+c*pow(10,br-br3-br2)+a;
s[5] = c*pow(10,br-br3)+a*pow(10,br-br1-br3)+b;
s[6] = c*pow(10,br-br3)+b*pow(10,br-br3-br2)+a;


for(int i = 1;i <= 6; i++)
{
	if(max < s[i])
	{
		max = s[i];
	}
}

cout<<max;
}