var a,k:integer;
BEGIN
k:=0;
repeat
read(a);
if (a>k) and (a mod 2=0) then
k:=a;
until a=0;
writeln(k);
end.
var a,k:integer;
BEGIN
k:=0;
repeat
read(a);
if (a>k) and (a mod 2=0) then
k:=a;
until a=0;
writeln(k);
end.