uses crt;
var g:array[1..5]of integer;
i,vtc,vtl:integer;
begin
clrscr;
for i:=1 to 5 do
begin
write('G[',i,']='); readln(g[i]);
end;
vtc:=0;
vtl:=0;
for i:=1 to 5 do
begin
if g[i] mod 2=0 then
begin
if vtc<i then vtc:=i;
end
else begin
if vtl<i then vtl:=i;
end;
end;
writeln('Vi tri phan tu le cuoi cung la: ',vtl);
writeln('Vi tri phan tu chan cuoi cung la: ',vtc);
readln;
end.