Pmin:=1;
for j:=1 to n do
begin
p:=1;
for i:=1 to n do
begin
p:=P*a[i,j];
end;
if j:=1 then Pmin:=p else
if Pmin>p then Pmin:=p;
b[j]:=p;
end;
writeln('minimal proizvedenie=',Pmin);
for j:=1 to n do
begin
if b[j]=Pmin then
str(Pmin,s);
end;
writeln(s);
end.