Prorgam zadacha;
Const n=7;
Var a:array [1..100] of integer;
i,p:integer;
Begin
p:=1;
For i:=1 to n do begin
Readln(a[i]);
End;
If (a[i]<0) then begin
If (a[i] mod 3=0) then p:=p*a[i];
end;
Writeln(p);
end.
var s,i,k:integer;
begin
s:=1;
for k:=1 to 7 do begin
readln(i);
if (i mod 3=0) and (i<0) then s:=s*i;
writeln(s);
Prorgam zadacha;
Const n=7;
Var a:array [1..100] of integer;
i,p:integer;
Begin
p:=1;
For i:=1 to n do begin
Readln(a[i]);
End;
For i:=1 to n do begin
If (a[i]<0) then begin
If (a[i] mod 3=0) then p:=p*a[i];
end;
end;
Writeln(p);
end.
var s,i,k:integer;
begin
s:=1;
for k:=1 to 7 do begin
readln(i);
if (i mod 3=0) and (i<0) then s:=s*i;
end;
writeln(s);
end.