var
a: array [1..100] of integer;
i,j,n,k: integer;
begin
readln(n);
for i:= 1 to n do readln(a[i]);
for i:= 1 to n do if Odd(i) then
for j:= 1 to n-i do if Odd(j) then
if a[j]>a[j+2] then begin
k:= a[j];
a[j]:= a[j+2];
a[j+2]:= k
end;
for i:= 1 to n do write(a[i],' ')
end.