Program vladimir37005;
const n=5;
var a:array[1..n] of integer;
i,min,k:integer;
begin
for i:=1 to n do begin
write('a[',i,']=');
read(a[i]);
end;
min:=a[1]; k:=1;
for i:=1 to n do
if (A[i] < min)
then begin
min:=A[i];
k:=i;
end;
for i:=1 to n do
if (a[i] < 0) and (a[i] > min)
then begin
min:=a[i];
k:=i;
end;
a[k]:=0;
for i:=1 to n do
write(a[i],' ');
end.