Var
a: array [1..10000] of integer;
i,j,k,m,n:integer;
begin
read(n);
for i := 1 to n do
read(a[i]);
for i := 1 to 3 do
begin
m := a[i];
k := i;
for j := i+1 to n do
if a[j] < m then
begin
m := a[j];
k := j
end;
for j := k downto i+1 do
a[j] := a[j-1];
a[i] := m
end;
for i := 1 to n do
write(a[i],' ')
end.