Var
a, b, c, d : integer;
begin
read (a, b, c, d);
if a mod 2 = 0 then
writeln (a + b + c + d);
if (b > 0) and (c > 0) then
writeln ((a + b + c + d) / 4);
if (a mod 2 = 0) and (b > 0) and (c > 0) then
writeln (a, ' ', b, ' ', c, ' ', d)
else
writeln (-a, ' ', -b, ' ', -c, ' ', -d);
end.