clear;
q:=11;
Fq:=GF(q);
Fq2<i>:=ExtensionField<Fq,x|x^2+1>;
a:=0;
b:=4;
E:=EllipticCurve([Fq|a,b]);
fac:=Factorization(#E);
fac2:=Factorization(#E(Fq2));
points:=Points(E(Fq2));

TorsPts:={};

for i:=1 to #points do
	if 3*points[i] eq Identity(E) then
		Include(~TorsPts,points[i]);
	end if;
end for;

function FlowerGenerator(TorsPts);
	V:={};
	S:=TorsPts;
	petals:=Integers()!Sqrt(#S)+1;
	ptsInPet:=petals-1;
	T:={};

	for i:=1 to petals do
		S:=S diff V;
  		P:=Random(S);
	        while P[3] eq 0 do
			P:=Random(S);
  		end while;
	V:={j*P:j in [1..ptsInPet]};
 	Include(~T,V);
	end for;
return T;
end function;

FlowerGenerator(TorsPts);

P:=E(Fq2)![9*i+7,i];
Q:=E(Fq2)![8,i];
R:=E(Fq2)![2*i+7,i];

pi:=FrobeniusMap(E);


