program compFourNums;
var
  a, b, c, d: smallint;

procedure swap(var x, y: smallint);
var temp:smallint;
begin
temp := x;
x := y;
y := temp;
end;

begin
readln(a, b, c, d);
if c<d then swap(c, d);
if b<c then swap(b, c);
if a<b then swap(a, b);
if c<d then swap(c, d);
if b<c then swap(b, c);
if c<d then swap(c, d);
writeln(a, ' ',  b, ' ',  c, ' ', d);
end.