Const n=4; var a:array [1..n,1..n] of integer; i,j,l,s1,s2:integer; b:array [1..4] of integer; begin for i:=1 to n do for j:=1 to n do readln(a[i,j]); for i:=1 to n do for j:=1 to n do begin if (a[i,j]>=1000) and (a[i,j]<=9999) then begin for l:=1 to 4 do b[l]:=a[i,j] mod 10; s1:=b[1]+b[2]; s2:=b[3]+b[4]; if s1=s2 then writeln(a[i,j]); end; end; end.
var a:array [1..n,1..n] of integer; i,j,l,s1,s2:integer; b:array [1..4] of integer;
begin
for i:=1 to n do
for j:=1 to n do
readln(a[i,j]);
for i:=1 to n do
for j:=1 to n do begin
if (a[i,j]>=1000) and (a[i,j]<=9999) then
begin
for l:=1 to 4 do
b[l]:=a[i,j] mod 10;
s1:=b[1]+b[2];
s2:=b[3]+b[4];
if s1=s2 then writeln(a[i,j]);
end;
end;
end.