varn,i,j, sum: integer;mas: array[1..100,1..100] of integer;beginsum:=0;readln(n);for i:=1 to n dobegin for j:=1 to n do read(mas[i,j]); readln;end;for i:=1 to n do inc(sum, mas[i,i]);for i:=1 to n do for j:=1 to n do if (mas[i,j]>sum) then dec(mas[i,j], sum);writeln('Вывод');for i:=1 to n dobegin for j:=1 to n do write(mas[i,j], ' '); writeln;end;end.