1)
program g;
var
a, b, c, d:integer;
begin
Readln(a, b, c, d) ;
if a = 0 then
Writeln('0') end ;
if b = 0 then
Writeln(a) end ;
if c = 0 then
Writeln(a + b) end ;
if d = 0 then
Writeln(a + b + c) end ;
end.
1)
program g;
var
a, b, c, d:integer;
begin
Readln(a, b, c, d) ;
begin
if a = 0 then
Writeln('0') end ;
begin
if b = 0 then
Writeln(a) end ;
begin
if c = 0 then
Writeln(a + b) end ;
begin
if d = 0 then
Writeln(a + b + c) end ;
end.