program nadovezivanje;
var r, l, i, x, y, z, A, B, C: longint;
var max: array [1..60] of longint;
var nizA: array [1..60] of longint;
var nizB: array [1..60] of longint;
var nizC: array [1..60] of longint;
var nizu1: array [1..60] of longint;
var nizu2: array [1..60] of longint;
var nizu3: array [1..60] of longint;
var nizu4: array [1..60] of longint;
var nizu5: array [1..60] of longint;
var nizu6: array [1..60] of longint;
var brx, bry, brz: integer;
begin
    read (A, B, C);
    r := 1;
    x := A;
    y := B;
    z := C;
    brx := 0;
    bry := 0;
    brz := 0;
    repeat
        x := x div 10;
        brx := brx + 1;
    until x>=1;
    x := A;
    repeat
        y := y div 10;
        bry := bry + 1;
    until y>=1;
    y := B;
    repeat
        z := z div 10;
        brz := brz + 1;
    until z>=1;
    z := C;
    for i := 1 to brx do
    begin
        for l:=1 to brx-i do
        r:=r*10;
        if x<10 then
        nizA[l]:=x mod 10
        else
        begin
            nizA[l]:=x div r;
            x:=x - (x div r)*r;
        end;
        r:=1
    end;    
    for i:=1 to bry do
    begin
        for l:=1 to bry-i do
        r:=r*10;
        if y<10 then
        nizB[l]:=y mod 10
        else
        begin
            nizB[l]:=y div r;
            y:=y - (y div r)*r;
        end;
        r:=1
    end;
    for i:=1 to brz do
    begin
        for l:=1 to brz-i do
        r:=r*10;
        if z<10 then
            nizC[l]:=z mod 10
        else
        begin
            nizC[l]:=z div r;
            z:=z - (z div r)*r;
        end;
        r:=1
    end;
    for i := 1 to brx do
    begin
        nizu1[i] := nizA[i];
    end;
    for i := brx+1 to brx+bry do
    begin
        nizu1[i] := nizB[i-brx];
    end;    
    for i := bry+brx+1 to brx+bry+brz do
    begin
        nizu1[i] := nizC[i-brx-bry];
    end;
    for i := 1 to brx do
    begin
        nizu2[i] := nizA[i];
    end;
    for i := brx+1 to brx+brz do
    begin
        nizu2[i] := nizC[i-brx];
    end;    
    for i := brx+brz+1 to brx+bry+brz do
    begin
        nizu2[i] := nizB[i-brx-brz];
    end;
    for i := 1 to bry do
    begin
        nizu3[i] := nizB[i];
    end;
    for i := bry+1 to brx+bry do
    begin
        nizu3[i] := nizA[i-bry];
    end;    
    for i := bry+brx+1 to brx+bry+brz do
    begin
        nizu3[i] := nizC[i-bry-brx];
    end;
    for i := 1 to bry do
    begin
        nizu4[i] := nizB[i];
    end;
    for i := bry+1 to brz+bry do
    begin
        nizu4[i] := nizC[i-bry];
    end;    
    for i := bry+brz+1 to brx+bry+brz do
    begin
        nizu4[i] := nizA[i-bry-brz];
    end;
    for i := 1 to brz do
    begin
        nizu5[i] := nizC[i];
    end;
    for i := brz+1 to brx+brz do
    begin
        nizu5[i] := nizA[i-brz];
    end;    
    for i := brz+brx+1 to brx+bry+brz do
    begin
        nizu5[i] := nizB[i-brz-brx];
    end;
    for i := 1 to brz do
    begin
        nizu6[i] := nizC[i];
    end;
    for i := brz+1 to brz+bry do
    begin
        nizu6[i] := nizB[i-brz];
    end;    
    for i := brz+bry+1 to brx+bry+brz do
    begin
        nizu6[i] := nizA[i-brz-bry];
    end;
    for i := 1 to brx+bry+brz do
    begin
    max[i] := nizu1[i];
    end;
    for i := 1 to brx+bry+brz do
    begin
        if max[i] > nizu2[i] then
        break;
        if max[i] < nizu2[i] then
        Begin
            for l:= 1 to brx+bry+brz do 
            max[l] := nizu2[l];
            break;
        end;
    end; 
     for i := 1 to brx+bry+brz do
    begin
        if max[i] > nizu3[i] then
        break;
        if max[i] < nizu3[i] then
        Begin
            for l:= 1 to brx+bry+brz do 
            max[l] := nizu3[l];
            break;
        end;
    end; 
     for i := 1 to brx+bry+brz do
    begin
        if max[i] > nizu4[i] then
        break;
        if max[i] < nizu4[i] then
        Begin
            for l:= 1 to brx+bry+brz do 
            max[l] := nizu4[l];
            break;
        end;
    end; 
     for i := 1 to brx+bry+brz do
    begin
        if max[i] > nizu5[i] then
        break;
        if max[i] < nizu5[i] then
        Begin
            for l:= 1 to brx+bry+brz do 
            max[l] := nizu5[l];
            break;
        end;
    end; 
     for i := 1 to brx+bry+brz do
    begin
        if max[i] > nizu6[i] then
        break;
        if max[i] < nizu6[i] then
        Begin
            for l:= 1 to brx+bry+brz do 
            max[l] := nizu6[l];
            break;
        end;
    end; 
    for i := 1 to brx+bry+brz do
        write (max[i]);
    end.