Var a:array of Integer; n,i,max,ind:Integer; begin Readln(n); SetLength(a,n); for i:=0 to Length(a) do readln(a[i]); max:=a[0]; ind:=0; for i:=0 to Length(a) do if abs(a[i])>abs(max) then begin max:=a[i]; ind:=i; end; n:=a[0]; a[0]:=max; a[ind]:=n; for i:=0 to Length(a) do write(a[i]:3); readln; end.
begin
Readln(n);
SetLength(a,n);
for i:=0 to Length(a) do
readln(a[i]);
max:=a[0];
ind:=0;
for i:=0 to Length(a) do
if abs(a[i])>abs(max) then
begin
max:=a[i];
ind:=i;
end;
n:=a[0];
a[0]:=max;
a[ind]:=n;
for i:=0 to Length(a) do
write(a[i]:3);
readln;
end.