var
a:array[1..100,1..100] of integer;
i,j,n,m,sum:integer;
begin
write('m=');
read(m);
write('n=');
read(n);
writeln;
for i:=1 to m do
for j:=1 to n do
begin
write(i,' ',j,': ');
read(a[i,j]);
end;
writeln;
for i:=1 to m do
begin
sum:=0;
for j:=1 to n do
inc(sum,a[i,j]);
writeln('Linia ',i,': ',sum);
end;
end.