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.