program zad;
uses crt;
var a,b,c,d:integer;
   Procedure Swap(var x,y:Integer);
   var t:integer;
   begin
   t:=x; x:=y; y:=t;
   end;
Begin
writeln('vvedite 4 chisla');
readln(a,b,c,d);
   if a>b then Swap(a,b);
   if c>d then Swap(c,d);
   if a>d then Swap(a,b);
   if b>c then Swap(b,c);
   if a>b then Swap(a,b);
   if c>d then Swap(c,d);
writeln(a:5, b:5, c:5,d:5);
readln;
End.