var
a, b, c, d : integer;
begin
read (a, b, c, d);
if (a <= 30) and (b <= 30) and (c <= 30) and (d <= 30) and (d mod 2 = 0) then</p>
write (a, ' ', b, ' ', c, ' ', d)
else if (a <= 30) and (b <= 30) and (c <= 30) and (d <= 30) then</p>
write (2 * a * b * c * d)
else if d mod 2 = 0 then
write (a * b / 10)
else write (a - d);
end.