uses crt;
const N=10;
var a:array[1..N] of integer;
i,k,m,min,imin:integer;
Begin
readln(m);
for i:=1 to m do begin
readln(a[i]);
min:=min+a[i];
end;
for i:=1 to m do begin
if a[i]<0 then begin<br>k:=i;
break;
end;
end;
for i:=1 to m do begin
if a[i]min:=a[i];
imin:=i;
end;
end;
min:=a[imin];
a[imin]:=a[k];
a[k]:=min;
for i:=1 to m do write(a[i],' ');
end.