//PascalABC.NET 3.1 сборка 1200
begin
var n := ReadInteger('n=');
var a := MatrixRandom(n, n, -10, 10);
println(a);
for var i := a.GetLowerBound(0) to a.GetUpperBound(0) do
if a[i, a.GetLowerBound(1)] < 0 then begin
var s1 := 0;
var s2 := 0;
var s3 := 0;
for var j := a.GetLowerBound(1) to a.GetUpperBound(1) do
if i < j then s1 += a[i, j]
else if i = j then s2 += a[i, j]
else if i > j then s3 += a[i, j];
writeln(i + ': ' + s1 + ', ' + s2 + ', ' + s3);
end;
end.