var a:array[1..1000,1..1000] of integer;
i,j,n,m,min,k,k1,str:integer;
begin
writeln('Vvedite razmernost massiva NxM');
readln(n);
readln(m);
for i:= 1 to n do
begin
for j:= 1 to m do begin
write('a[',i,',',j,']:=');
read(a[i,j]);
end;
end;
min:=a[1,1];
for i:=1 to n do
for j:=1 to m do
begin
if a[i,j]begin
min:=a[i,j];
end;
end;
k:=0;
for i:=1 to n do
begin
for j:=1 to n do
begin
if a[i,j]=min then
k1:=k1+1;
end;
if k1>k then
begin
k:=k1;
str:=i;
end;
end;
writeln('Stroka s max kolich min elementov: ',str);
for i:=1 to n do
begin
for j:=1 to m do
write(a[i,j]:10);
writeln;
end;
end.