program nadovezivanje;
var p,f,a,b,c,a1,b1,c1,br,k:int64;
    n,d:Array[1..3] of int64;
    i,j:integer;
begin
read(a,b,c);
p:=0; f:=0;
n[1]:=0;
n[2]:=0;
n[3]:=0;
a1:=a;
b1:=b;
c1:=c;
d[1]:=a;
d[2]:=b;
d[3]:=c;
while a1>0 do
begin
n[1]:=n[1]+1;
a1:=a1 div 10;
end;
while b1>0 do
begin
n[2]:=n[2]+1;
b1:=b1 div 10;
end;
while c1>0 do
begin
n[3]:=n[3]+1;
c1:=c1 div 10;
end;
for i:=1 to 2 do
for j:=i+1 to 3 do
if n[i]=n[j] then
begin
    if d[j]>d[i] then
    begin
    p:=d[j];
    f:=n[j];
    n[j]:=n[i];
    n[i]:=f;
    d[j]:=d[i];
    d[i]:=p;
    end;
end
else
if n[i]>n[j] then
begin
a:=d[i];
for k:=1 to (n[i]-n[j]) do
a:=a div 10;
if d[j]>a then
begin
p:=d[i];
d[i]:=d[j];
d[j]:=p;
 f:=n[j];
    n[j]:=n[i];
    n[i]:=f;
end;
end else
begin
a:=d[j];
for k:=1 to (n[j]-n[i]) do
a:=a div 10;
if a>d[i] then
begin
p:=d[i];
d[i]:=d[j];
d[j]:=p;
f:=n[j];
n[j]:=n[i];
n[i]:=f;
end;
end;
br:=0;
br:=br+d[1];
for i:=1 to n[2] do
br:=br*10;
br:=br+d[2];
for i:=1 to n[3] do
br:=br*10;
br:=br+d[3];
write(br);
end.