var a,max:integer;beginmax:=0;a:=0;read(a);while a<>0 dobegin if (a mod 2=0) and (a>=max) then max:=a; read(a);end;write(max);end.
var a,max:integer;
begin
max:=0;
a:=0;
read(a);
while a<>0 do
begin
if (a mod 2=0) and (a>=max) then max:=a;
read(a);
end;
write(max);
end.