uses crt;
var n,i,even,odd: integer;
a: array[1..100] of int64;
begin
even := 0;
odd := 0;
readln(n);
for i := 1 to n do
begin
read(a[i]);
if a[i] mod 2 = 0 then inc(even) else inc(odd);
end;
for i := 1 to n do
if ((a[i] mod 2 = 0) and (even = 1))
or ((a[i] mod 2 <> 0) and (odd = 1)) then
begin
write(a[i]);
break;
end;
end.