program takmicenje;
var i, x, n, min, maxx, minn, s, l, najv, najm :integer;
var a:array[1 .. 3] of integer;
var b:array[1 .. 3]  of integer;
begin
        min:= 19;
        for i:= 1 to 3 do
         begin
         read(a[i]);
         writeln;;
         x:= a[i];
         n:=0;
         while x >0 do
                begin
                n:= n +1;
                x:= x / 10;
                end;
         if n < min then
         min:= n;
         end;

        for l := 1 to 3 do
        begin
                b[l]:= a[l];
                while b[l]> (min+1)*10 do
                begin
                b[i]:= b[i] / 10
                end;
                if b[l] > maxx then
                begin
                maxx:= b[l];
                najv:= a[l];
                end;

                if b[l] < minn  then
                begin
                minn := b[l];
                najm:= a[l];
                end;
        end;
        s:= a[1]+ a[2]+a[3];
        s:= s - najm;
        s:= s- najv;
        write(najv);
        writeln;
        write(s);
        writeln;
        write(najm);
end.