program bai1;
var a:array[1..100] of longint;
i,n,s:longint;
begin
write('N= ');readln(n);
for i:=1 to n do
begin
write('A[',i,']= ');
readln(a[i]);
end;
for i:=1 to n do
if a[i] mod 2=0 then write(a[i],' ');
s:=a[2]+3*a[7];
write('Tong la ',s);
readln
end.