uses crt; var m1,m2,m3,m6,n,i,a : integer; r,p: longint; begin readln (n); m1:=1001;m2:=1001;m3:=1001; m6:=1001; p:= 1000001; readln (a); for i:=2 to n do begin if (a< m1) then m1:= a; if (a< m2) and (a mod 2=0)then m2:= a; if (a< m3) and (a mod 3=0)then m3:= a; if (a< m6) and (a mod 6=0)then m6:= a; readln (a); if (m1*a mod 6 = 0) and (m1 * a < p)then p:= m1*a; if (m2*a mod 6 = 0) and (m2 * a < p)then p:= m2*a; if (m3*a mod 6 = 0) and (m3 * a < p)then p:= m3*a; if (m6*a mod 6 = 0) and (m6 * a < p)then p:= m6*a; end; readln (r); if p=1000001 then p:=0; writeln( 'вычисленное контрольное значение', p); if p=r then writeln('Контроль пройден') else writeln('Контроль не пройден'); end.