var
i,j,s:integer;
x:array[1..8,1..8] of integer;
y:array[1..10,1..10] of integer;
begin
s:=0;
for i:=1 to 8 do
for j:=1 to 8 do
begin
readln(x[i,j]);
if i<=j then s:=s+x[i,j];</p>
end;
writeln("Сумма для X=", s);
s:=0;
for i:=1 to 10 do
for j:=1 to 10 do
begin
readln(y[i,j]);
if i<=j then s:=s+y[i,j];</p>
end;
writeln("Сумма для Y=", s);
end.