const n=10;
var
a:array [1..n] of integer;
i,s:integer;
begin
Randomize;
for i:=1 to n do
begin
a[i]:=random(100);
write(a[i],' ');
end;
for i:=1 to n do if (a[i] mod 2 =1) and (a[i] mod 3 =0) then if s=0 then s:=a[i] else s:=s*a[i];
writeln;
writeln(s);
end.