var n,i,zhi,he:longint;
a:qword;
f:boolean;
function pow(x,n,k:qword):qword overload;
begin
if n=0 then exit(1);
pow:=pow(x,n div 2,k) mod k;
pow:=pow*pow mod k;
if n mod 2=1 then pow:=pow*x mod k;
end;
function ff(n:longint):boolean overload;
var m:qword;
i:longint;
begin
randomize;
for i:=1 to 200 do begin
m:=random(n-2)+1;
if pow(m,n-1,n)<>1 then exit(False);
end;
exit(True);
end;
begin
{assign(output,'aa.txt');
rewrite(output); }
readln(n);
for i:=1 to n do begin
readln(a);
if (a=0)or(a=1)then begin
inc(he);
writeln('FALSE');
continue;
end;
f:=ff(a);
if f then inc(zhi) else inc(he);
writeln(f);
end;
writeln(zhi,' ',he);
{close(output); }
end.