SizeScreen([76, ]);;
SetInfoLevel(InfoFpGroup,2);
F := FreeGroup( 10 );
relsG := [
  F.1^2, F.2^2, F.3^2, F.4^2, F.5^2, F.6^2, F.7^2, F.8^2, F.9^2,
  (F.1*F.2)^4, (F.1*F.3)^5, (F.1*F.4)^3, (F.1*F.5)^2, (F.1*F.6)^2*F.8,
  (F.1*F.7)^2*F.9, (F.1*F.8)^2, (F.1*F.9)^2, (F.2*F.3)^2*F.4*F.7,
  (F.2*F.4)^2, (F.2*F.5)^2, (F.2*F.6)^2*F.4, (F.2*F.7)^2, (F.2*F.8)^3,
  (F.2*F.9)^2*F.5, (F.3*F.4)^2, (F.3*F.5)^2*F.4, (F.3*F.6)^2,
  (F.3*F.7)^2, (F.3*F.8)^2*F.7, (F.3*F.9)^2*F.6*F.7,
  (F.4*F.5)^2, (F.4*F.6)^2, (F.4*F.7)^2, (F.4*F.8)^2*F.6,
  (F.4*F.9)^2*F.7, (F.5*F.6)^2*F.7, (F.5*F.7)^2, (F.5*F.8)^2*F.9,
  (F.5*F.9)^2, (F.6*F.7)^2, (F.6*F.8)^2, (F.6*F.9)^2, (F.7*F.8)^2,
  (F.7*F.9)^2, (F.8*F.9)^2,
  F.10^2, (F.4*F.10)^2*F.5, Comm(F.10,F.1*F.4),
  (F.3*F.10)^3, (F.10*F.6)^2*F.7*F.9,
  (F.10*F.2)^2*F.5*F.7 ];;
G := F / relsG;;
relsM := [ (F.1*F.3*F.2)^8, (F.10*F.3*F.1)^7 ];
relsM:=Concatenation(relsM,relsG);;
M := F / relsM;;
UM:=[M.2,M.3,M.4,M.5,M.6,M.7,M.8,M.9,M.10, M.1*M.4*(M.3*M.1)^2 ];;
UM := Subgroup( M, UM);
tab:=CosetTable(M,UM);;
Length(tab[1]);
perm:=List(tab{[1,3..Length(tab)-1]},PermList);;
mcl:=Group(perm);
Size(mcl);
DisplayCompositionSeries(mcl);
hom:=GroupHomomorphismByImages(G,mcl,GeneratorsOfGroup(G),perm);
s:=PreImage(hom,Stabilizer(mcl,1));
Index(G,s);
hom2:=IsomorphismFpGroup(s);
q:=Range(hom2);
gens:=List(GeneratorsOfGroup(q),
i->Image(hom,PreImagesRepresentative(hom2,i)));
h3:=GroupHomomorphismByImages(q,Subgroup(mcl,gens),
GeneratorsOfGroup(q),gens);
o:=Orbits(Range(h3),[1..275]);;
o:=First(o,i->Length(i)=112);;
t:=Stabilizer(Image(h3),o[1]);
DisplayCompositionSeries(t);
tp:=PreImage(h3,t);
Index(q,tp);
maxab:=MaximalAbelianQuotient(tp);
Size(Image(maxab));
U:=PreImage(hom2,tp);
Index(G,U);
Ugens:=GeneratorsOfGroup(U);;
Length(Ugens);
Umax:=RestrictedMapping(hom2,U)*maxab;
Ucosrep:=DefiningQuotientHomomorphism(U);
perms:=KuKGenerators(G,Ucosrep,Umax);
NrMovedPoints(perms);
IsomorphismSimplifiedFpGroup(G);
p2:=perms{[1,2,3,6,10]};;
p3:=StraightLineProgGens(p2);
P:=Group(p3);
StabChainOptions(P).random:=1;;
s:=Size(P);                      
s:=s/Size(mcl);
Collected(Factors(s));
bas:=BaseStabChain(StabChainMutable(P));
Length(bas);
p3:=StraightLineProgGens(p2,bas);;
P:=Group(p3);
SetSize(P,Size(mcl)*3^104);
elm:=(P.5*P.3*P.1)^7; 
Order(elm);
S:=SubgroupNC(P,[elm]);
N:=SolvableNormalClosurePermGroup(P,S);
Collected(Factors(Size(N)));
IsElementaryAbelian(N);
pcgs:=Pcgs(N);
mats:=LinearActionLayer(P,pcgs);
module:=GModuleByMats(mats,GF(3));
MTX.IsIrreducible(module);
quit;
