Var
a:array [1..10, 1..10] of integer;
i,j,s1,s2,m,n:integer;
begin
writeln('Введите через пробел M, N:');
read(m,n);
randomize;
for i:=1 to m do
begin
for j:=1 to n do
begin
a[i,j]:=random(10);
write(a[i,j],' ')
end;
writeln;
end;
for i:=1 to m do
begin
s2:=0;
for j:=1 to n do
if i=1 then s1:=s1+a[i,j]
else s2:=s2+a[i,j];
if s2>s1 then s1:=s2;
end;
writeln(s1)
end.