>>723 #include<stdio.h>
void swap(int *a, int *b){
int c;
c=*a; *a=*b; *b=c;
}
int main(void){
int max1=0, max2=0, num;
while(scanf("%d", &num)==1){
if(num==0) break;
if(num<0 || num%2==1) continue;
if(num>max2) max2=num;
if(max1<max2) swap(&max1, &max2);
}
printf("%d\n", max2);
return 0;
}