const N=5; var a: array [0..N] of integer; i, k, start_index, end_index : integer; wer : boolean ; begin start_index:= 0; end_index := N - 1; for i:=1 to N do readln(a[i]); wer:= True; while wer = True do begin wer:= False; for i:=start_index to end_index do if (a[i] > a[i + 1]) then begin k:= a[i]; a[i]:= a[i + 1]; a[i + 1] := k; wer:= True; end; if (not(wer))then break ; wer:= False ; for i:=end_index downto start_index + 1 do if (a[i] < a[i - 1]) then begin k:= a[i-1]; a[i-1]:= a[i]; a[i] := k; wer := True; end; start_index := start_index + 1; end; for i:=1 to N do writeln(a[i]); end.