unittest
{
	assert( [ "1 5 2" ].parse.expand.solve == 53 );
	assert( [ "9 9 9" ].parse.expand.solve == 108 );
	assert( [ "6 6 7" ].parse.expand.solve == 82 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto abc = input.front.split.to!( long[] );
	return tuple( abc );
}

auto solve( long[] abc )
{
	auto m = abc.reduce!max;
	if( m == abc[ 0 ] ) return abc[ 0 ] * 10 + abc[ 1 ] + abc[ 2 ];
	if( m == abc[ 1 ] ) return abc[ 0 ] + abc[ 1 ] * 10 + abc[ 2 ];
	if( m == abc[ 2 ] ) return abc[ 0 ] + abc[ 1 ] + abc[ 2 ] * 10;
	
	assert( false );
}
