load "Subgroups/functions.txt";
load "Subgroups/E8/ComputeFactorsE8.txt";

load "Traces/E8/Tr17E8Eigs";
Tr17E8:={[&+i]:i in Tr17E8Eigs};
delete Tr17E8Eigs;

Tr cat:=<{},Tr17E8>;

function OrbitReps(X,g)

Orbs:=[];
SpanOfOrbs:=[];
for i in X do
  if(not(Sort(i) in SpanOfOrbs)) then
    Append(~Orbs,i);
    SpanOfOrbs cat:=[Sort(i^(g^j)):j in [1..Order(g)-1]];
  end if;
end for;
return Orbs;
end function;


function FindOrb(Orbs,i)
for Orb in Orbs do if(i in Orb) then return Orb; end if; end for;
return {};
end function;

q:=2^8;
F<w>:=GF(q);
G:=GroupOfLieType("E8",q);
V:=VectorSpace(GF(q),8);
rho1:=StandardRepresentation(G);
Over1:=GL(248,q);
g1:=elt<G|V![w,1,1,1,1,1,1,1]>;
g2:=elt<G|V![1,w,1,1,1,1,1,1]>;
g3:=elt<G|V![1,1,w,1,1,1,1,1]>;
g4:=elt<G|V![1,1,1,w,1,1,1,1]>;
g5:=elt<G|V![1,1,1,1,w,1,1,1]>;
g6:=elt<G|V![1,1,1,1,1,w,1,1]>;
g7:=elt<G|V![1,1,1,1,1,1,w,1]>;
g8:=elt<G|V![1,1,1,1,1,1,1,w]>;
W:=Reflections(G);
Mats1:=[rho1(i):i in [g1,g2,g3,g4,g5,g6,g7,g8]];
MatsE:=[rho1(i):i in W];
NGT:=sub<Over1|Mats1 cat MatsE>;
T:=sub<NGT|Mats1>;
E:=sub<NGT|MatsE>;

T17:=sub<T|[T.i^15:i in [1..8]]>;
T85:=sub<T|[T.i^3:i in [1..8]]>;

R:=ResidueClassRing(255);
X:=[[R!Log((T.j)[i,i]):i in [1..248]]:j in [1..8]];

"Obtaining eigenvalues of simple modules on PSL(3,16)";

G2:=PSL(3,16);
CC:=ConjugacyClasses(G2);
X1:=CompositionFactors(PermutationModule(G2,GF(16)));
for i in X1 do if(Dimension(i) eq 9) then S912:=i; break i; end if; end for;
X2:=[i:i in CompositionFactors(TensorProduct(S912,Dual(S912)))|Dimension(i) eq 8];
if(IsIsomorphic(X2[2],FrobeniusImage(X2[1],1))) then S81:=X2[1]; else S81:=X2[2]; end if;
S1:=TrivialModule(G2,GF(16));
S82:=GModule(G2,FrobeniusImage(S81,1));
S83:=GModule(G2,FrobeniusImage(S81,2));
S84:=GModule(G2,FrobeniusImage(S81,3));
S912d:=Dual(S912);
S923:=GModule(G2,FrobeniusImage(S912,1)); S923d:=Dual(S923);
S934:=GModule(G2,FrobeniusImage(S912,2)); S934d:=Dual(S934);
S914:=GModule(G2,FrobeniusImage(S912,3)); S914d:=Dual(S914);
for i in CompositionFactors(TensorProduct(S912,S923)) do
  if(Dimension(i) eq 27) then S27123:=i; elif Dimension(i) eq 9 and not(IsIsomorphic(i,S914)) then S913:=i; end if;
end for;
S913d:=Dual(S913); S27123d:=Dual(S27123);
S924:=GModule(G2,FrobeniusImage(S913,1)); S924d:=Dual(S924);
S27234:=GModule(G2,FrobeniusImage(S27123,1)); S27234d:=Dual(S27234);
S27134:=GModule(G2,FrobeniusImage(S27123,2)); S27134d:=Dual(S27134);
S27124d:=GModule(G2,FrobeniusImage(S27123,3)); S27124:=Dual(S27124d); //This one has to be dual because the original was 3_2 x 3_3^* x 3_4.
S6412:=TensorProduct(S81,S82);
S6413:=TensorProduct(S81,S83);
S6414:=TensorProduct(S81,S84);
S6423:=TensorProduct(S82,S83);
S6424:=TensorProduct(S82,S84);
S6434:=TensorProduct(S83,S84);
Irr2:=  [S1,S81,S82,S83,S84,S912,S912d,S913,S913d,S914,S914d,S923,S923d,S924,S924d,S934,S934d,
S27123,S27123d,S27234,S27234d,S27134,S27134d,S27124,S27124d,S6412,S6413,S6414,S6423,S6424,S6434];
for i in Irr2 do for j in Irr2 do if(Dimension(i) eq 8 and Dimension(j) eq 9 and IsIrreducible(TensorProduct(i,j))) then
  Append(~Irr2,TensorProduct(i,j));
end if; end for; end for;
Append(~Irr2,TensorProduct(S912,S934)); Append(~Irr2,Dual(Irr2[#Irr2]));
Append(~Irr2,TensorProduct(S912,S934d)); Append(~Irr2,Dual(Irr2[#Irr2]));
Append(~Irr2,TensorProduct(S913,S924d)); Append(~Irr2,Dual(Irr2[#Irr2]));
for i in [39..70] do
  if(EigenvaluesOfElement(ChangeRing(S81,F),CC[i,3]) eq { <1, 2>, <w^6, 1>, <w^96, 1>, <w^90, 1>, <w^159, 1>, <w^249, 1>, <w^165, 1> }) then
    x:=CC[i,3]; break i;
  end if;
end for;

"This bit will take a long time";

Ans3,Mods,Irr:=ComputeConspicuousFactorsE8LowMemory(Irr2,CC,Tr,[17,13,15],[]);

// If you don't want to sit through that, just go with the one below.

ConspAll:=[
 [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,6,7],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,13],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,16,17],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,10,11],
 [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,5,5,5,5,5,5,5,5,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,4,4,4,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,4,5,5,5,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17],
 [1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,4,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,12,13],
 [1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,5,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,14,15],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,3,3,3,3,3,3,3,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,9],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,4,4,4,4,4,4,4,4,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,11],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,5,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,16,17],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,4,4,4,4,4,4,4,4,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,15],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,5,5,5,5,5,5,5,5,6,7,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,5,5,5,5,5,5,5,5,8,9,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17],
 [1,1,1,1,1,1,1,1,2,2,2,2,10,10,10,10,10,10,11,11,11,11,11,11,14,14,15,15,28],
 [1,1,1,1,1,1,1,1,2,3,4,6,6,6,7,7,7,8,8,8,9,9,9,12,12,12,13,13,13,18,19],
[1,1,1,1,1,1,1,1,2,3,5,6,6,6,7,7,7,10,10,10,11,11,11,14,14,14,15,15,15,24,25],
[1,1,1,1,1,1,1,1,2,4,5,8,8,8,9,9,9,10,10,10,11,11,11,16,16,16,17,17,17,22,23],
[1,1,1,1,1,1,1,1,3,3,3,3,6,6,6,6,6,6,7,7,7,7,7,7,8,8,9,9,26],
[1,1,1,1,1,1,1,1,3,4,5,12,12,12,13,13,13,14,14,14,15,15,15,16,16,16,17,17,17,20,21],
[1,1,1,1,1,1,1,1,4,4,4,4,12,12,12,12,12,12,13,13,13,13,13,13,14,14,15,15,29],
[1,1,1,1,1,1,1,1,5,5,5,5,8,8,9,9,16,16,16,16,16,16,17,17,17,17,17,17,31],
 [1,1,1,1,1,1,2,2,6,7,10,10,10,11,11,11,14,14,15,15,24,25,28],
[1,1,1,1,1,1,3,3,6,6,6,7,7,7,8,8,9,9,12,13,18,19,26],
[1,1,1,1,1,1,4,4,12,12,12,13,13,13,14,14,15,15,16,17,20,21,29],
[1,1,1,1,1,1,5,5,8,8,9,9,10,11,16,16,16,17,17,17,22,23,31],
 [1,1,1,1,2,3,6,7,12,13,26,26,26],
 [1,1,1,1,2,4,6,7,16,17,27,27,27],
[1,1,1,1,2,5,6,7,10,11,28,28,28],
[1,1,1,1,3,4,12,13,16,17,29,29,29],
[1,1,1,1,3,5,10,11,12,13,30,30,30],
[1,1,1,1,4,5,10,11,16,17,31,31,31],
 [1,1,1,1,6,6,7,7,10,11,14,14,14,15,15,15,16,17,24,25,30],
[1,1,1,1,6,7,8,8,8,9,9,9,10,11,12,12,13,13,18,19,27],
[1,1,1,1,6,7,12,13,14,14,14,15,15,15,16,16,17,17,20,21,30],
[1,1,1,1,8,8,8,9,9,9,10,10,11,11,12,13,16,17,22,23,27]
];

[IdentifyFactors(i,Irr2):i in Mods] eq ConspAll;

// These are orbit representatives for ConspAll.

g:=Sym(#Irr2)![IdentifyModule(GModule(G2,FrobeniusImage(i,1)),Irr2):i in Irr2];


Consp:=[
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,6,7],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,4,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,12,13],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,5,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,14,15],
[1,1,1,1,1,1,1,1,2,2,2,2,10,10,10,10,10,10,11,11,11,11,11,11,14,14,15,15,28],
[1,1,1,1,1,1,1,1,2,3,4,6,6,6,7,7,7,8,8,8,9,9,9,12,12,12,13,13,13,18,19],
[1,1,1,1,1,1,2,2,6,7,10,10,10,11,11,11,14,14,15,15,24,25,28],
[1,1,1,1,2,3,6,7,12,13,26,26,26],
[1,1,1,1,2,4,6,7,16,17,27,27,27],
[1,1,1,1,6,6,7,7,10,11,14,14,14,15,15,15,16,17,24,25,30]
];

Consp eq OrbitReps(ConspAll,g);

Mods2:=[DirectSum([Irr2[i]:i in j]):j in Consp];

Eigs1:=[EigenvaluesOfElement(ChangeRing(i,F),x):i in Mods2];
Eigs2:=[EigenvaluesOfElement(ChangeRing(i,F),x^5):i in Mods2];

El1:=[
    [ 11, 0, 0, 2, 0, 0, 0, 0 ],
    [ 9, 2, 0, 2, 0, 0, 0, 0 ],
    [ 5, 6, 0, 2, 0, 0, 0, 0 ],
    [ 0, 0, 16, 15, 3, 2, 13, 3 ],
    [ 3, 13, 15, 2, 2, 15, 2, 13 ],
    [ 0, 15, 6, 15, 13, 2, 2, 8 ],
    [ 1, 1, 3, 12, 4, 16, 16, 3 ],
    [ 8, 2, 13, 9, 10, 13, 6, 13 ],
    [ 14, 8, 16, 1, 4, 6, 0, 15 ],
    [ 10, 13, 2, 4, 15, 4, 0, 11 ]
];

El2:=[
    [ 186, 0, 153, 6, 0, 0, 0, 0 ],
    [ 180, 159, 0, 159, 102, 0, 0, 0 ],
    [ 117, 69, 51, 6, 102, 0, 0, 0 ],
    [ 0, 0, 48, 45, 162, 6, 39, 162 ],
    [ 213, 141, 45, 210, 159, 45, 6, 39 ],
    [ 102, 96, 69, 249, 90, 6, 57, 24 ],
    [ 3, 3, 162, 138, 114, 252, 48, 9 ],
    [ 75, 6, 90, 180, 234, 243, 18, 90 ],
    [ 195, 126, 150, 105, 165, 120, 153, 96 ],
    [ 132, 192, 6, 114, 45, 114, 51, 33 ]
];

El3:=[
    [ 147, 0, 51, 2, 0, 0, 0, 0 ],
    [ 230, 53, 0, 53, 34, 0, 0, 0 ],
    [ 124, 193, 187, 2, 34, 0, 0, 0 ],
    [ 0, 0, 16, 185, 54, 172, 13, 54 ],
    [ 241, 47, 15, 240, 223, 15, 2, 13 ],
    [ 119, 117, 23, 253, 115, 2, 19, 8 ],
    [ 171, 171, 139, 216, 123, 84, 16, 3 ],
    [ 195, 172, 30, 60, 248, 166, 6, 30 ],
    [ 150, 212, 220, 35, 140, 40, 51, 32 ]
];

El3a:=[
    [ 232, 0, 136, 2, 0, 0, 0, 0 ],
    [ 145, 138, 0, 138, 34, 0, 0, 0 ],
    [ 124, 193, 187, 87, 34, 0, 0, 0 ],
    [ 0, 0, 16, 100, 139, 87, 13, 139 ],
    [ 71, 132, 100, 155, 223, 100, 87, 13 ],
    [ 204, 202, 108, 253, 200, 2, 104, 8 ],
    [ 86, 86, 54, 131, 38, 169, 16, 3 ],
    [ 25, 87, 115, 230, 78, 81, 6, 115 ],
    [ 235, 42, 135, 120, 140, 125, 51, 32 ]
];

h1:=ProduceGroupElements(T17,El1);
h2:=ProduceGroupElements(T,El2);
h3:=ProduceGroupElements(T,El3);
h3a:=ProduceGroupElements(T,El3a);

&and[h1[i] eq h2[i]^5:i in [1..#h2]];
&and[h2[i] eq h3[i]^3:i in [1..#h3]];
&and[h2[i] eq h3a[i]^3:i in [1..#h3a]];
&and[#Eigenvalues(h2[i]) eq #Eigenvalues(h3[i]):i in [1..#h3]];
&and[#Eigenvalues(h2[i]) eq #Eigenvalues(h3a[i]):i in [1..#h3a]];
&and[Order(sub<T|h3[i],h3a[i]>) eq 765:i in [1..#h3a]];

Eigs2 eq [Eigenvalues(i):i in h1];
Eigs1 eq [Eigenvalues(i):i in h2];

NextEls1All:=[
[[186,0,153,6,0,0,0,0],[84,0,102,159,0,0,0,0]],
[[180,159,0,159,102,0,0,0],[180,6,0,6,153,0,0,0],[180,159,0,6,153,102,0,0],[180,6,0,159,102,153,0,0],
[180,159,0,6,0,153,102,0],[180,6,0,159,0,102,153,0],[180,6,0,159,0,0,0,102],[180,159,0,6,0,0,153,102],
[180,159,0,6,0,0,0,153],[180,6,0,159,0,0,102,153]],
[[117,69,51,6,102,0,0,0],[168,69,204,57,102,0,0,0],[117,171,51,108,153,0,0,0],[168,171,204,159,153,0,0,0],
[117,69,51,108,153,102,0,0],[168,69,204,159,153,102,0,0],[117,171,51,6,102,153,0,0],[168,171,204,57,102,153,0,0],
[117,69,51,108,0,153,102,0],[168,69,204,159,0,153,102,0],[117,171,51,6,0,102,153,0],[168,171,204,57,0,102,153,0],
[117,171,51,6,0,0,0,102],[168,171,204,57,0,0,0,102],[117,69,51,108,0,0,153,102],[168,69,204,159,0,0,153,102],
[117,69,51,108,0,0,0,153],[168,69,204,159,0,0,0,153],[117,171,51,6,0,0,102,153],[168,171,204,57,0,0,102,153]],
[[0,0,48,45,162,6,39,162],[204,0,48,45,162,6,90,162],[0,204,48,45,162,6,90,162],[51,0,252,45,162,6,90,162],
[0,51,48,249,162,6,90,162],[0,204,48,45,213,210,90,162],[51,0,48,249,213,210,90,162],[0,51,48,249,213,210,90,162],
[204,0,99,249,213,210,90,162],[0,0,48,249,213,210,141,162],[0,0,252,96,162,210,39,213],[204,0,48,45,213,159,90,213],
[51,0,252,45,213,159,90,213],[0,51,252,45,213,159,90,213],[0,204,252,96,213,159,90,213],[0,51,252,45,162,210,90,213],
[51,0,201,96,162,210,90,213],[204,0,252,96,162,210,90,213],[0,204,252,96,162,210,90,213],[0,0,252,45,213,159,141,213]],
[[213,141,45,210,159,45,6,39],[162,90,96,210,159,45,6,39],[213,141,45,159,210,45,6,39],[162,141,45,210,210,249,6,39],
[162,141,45,159,6,45,210,39],[162,141,45,210,210,45,210,39],[111,90,96,210,210,45,210,39],[162,90,96,210,159,96,210,39],
[213,141,45,159,210,96,210,39],[162,90,96,159,210,96,210,39],[162,39,45,6,159,45,6,90],[213,90,249,6,159,45,6,90],
[213,90,249,210,210,45,6,90],[162,90,249,6,210,249,6,90],[213,141,45,159,6,45,159,90],[162,90,96,159,6,45,159,90],
[162,90,96,210,210,45,159,90],[213,90,96,159,210,96,159,90],[162,90,249,210,6,45,210,90],[213,90,96,210,159,45,210,90],
[111,39,45,6,210,45,210,90],[162,90,249,6,210,45,210,90],[9,141,45,159,210,45,210,90],[213,90,96,159,210,45,210,90],
[162,39,45,6,159,96,210,90],[162,39,45,210,210,96,210,90],[213,90,249,210,210,96,210,90],[213,141,45,159,6,249,210,90],
[213,141,45,210,210,249,210,90],[162,90,96,210,210,249,210,90],[162,39,45,210,6,45,159,141],[213,90,249,210,6,45,159,141],
[162,39,45,6,210,45,159,141],[213,39,45,210,210,96,159,141],[213,39,45,6,159,45,210,141],[213,39,45,210,210,45,210,141],
[9,90,249,210,210,45,210,141],[213,90,249,210,6,249,210,141],[162,39,45,6,210,249,210,141],[213,90,249,6,210,249,210,141]],
[[102,96,69,249,90,6,57,24],[153,96,171,249,90,6,57,24],[0,249,171,249,192,159,57,24],[0,249,69,96,90,159,159,24],
[51,96,171,249,90,6,6,75],[204,96,222,249,90,6,6,75],[153,96,69,198,141,6,6,75],[102,96,222,198,141,6,6,75],
[0,147,171,249,39,57,6,75],[102,147,69,198,90,57,6,75],[153,147,171,198,90,57,6,75],[51,249,171,198,243,159,6,75],
[204,249,222,198,243,159,6,75],[153,96,18,249,90,6,57,75],[102,96,171,249,90,6,57,75],[0,198,171,249,243,108,57,75],
[0,147,69,96,192,57,108,75],[153,249,69,96,90,159,108,75],[102,249,222,96,90,159,108,75],[51,96,18,147,192,6,159,75],
[204,96,69,147,192,6,159,75],[102,198,69,147,90,108,159,75],[153,198,171,147,90,108,159,75],[0,198,69,96,141,108,159,75],
[153,249,18,147,39,159,159,75],[102,249,171,147,39,159,159,75],[51,249,18,96,90,159,159,75],[204,249,69,96,90,159,159,75],
[0,96,171,249,90,6,6,126],[0,96,69,96,243,6,108,126],[102,249,69,96,90,159,108,126],[153,249,171,96,90,159,108,126],
[0,147,69,198,90,57,6,177],[0,249,69,249,192,159,6,177],[153,249,69,198,243,159,6,177],[102,249,222,198,243,159,6,177],
[51,96,18,249,90,6,57,177],[204,96,69,249,90,6,57,177],[102,198,69,249,243,108,57,177],[153,198,171,249,243,108,57,177],
[153,249,18,249,192,159,57,177],[102,249,171,249,192,159,57,177],[102,96,69,147,192,6,159,177],[153,96,171,147,192,6,159,177],
[51,96,171,96,243,6,159,177],[204,96,222,96,243,6,159,177],[0,147,171,96,192,57,159,177],[0,249,171,147,39,159,159,177],
[0,96,69,198,141,6,6,228],[0,198,69,249,243,108,6,228],[51,249,18,249,192,159,6,228],[204,249,69,249,192,159,6,228],
[102,249,69,198,243,159,6,228],[153,249,171,198,243,159,6,228],[153,96,69,96,243,6,108,228],[102,96,222,96,243,6,108,228],
[102,147,69,96,192,57,108,228],[153,147,171,96,192,57,108,228],[51,249,171,96,90,159,108,228],[204,249,222,96,90,159,108,228],
[153,96,18,147,192,6,159,228],[102,96,171,147,192,6,159,228],[0,96,171,96,243,6,159,228],[0,198,171,147,90,108,159,228]],
[[3,3,162,138,114,252,48,9],[207,207,162,138,165,252,48,9],[3,207,213,138,114,48,201,9],[207,156,213,138,165,48,201,9],
[3,3,162,138,165,252,201,9],[207,207,162,138,216,252,201,9],[3,3,213,87,114,48,252,9],[207,207,213,87,165,48,252,9],
[3,207,162,189,114,252,252,9],[3,54,162,87,165,252,252,9],[207,156,162,189,165,252,252,9],[207,3,162,87,216,252,252,9],
[3,207,213,138,114,48,48,111],[3,54,213,36,165,48,48,111],[207,156,213,138,165,48,48,111],[207,3,213,36,216,48,48,111],
[3,3,162,138,165,252,48,111],[207,207,162,138,216,252,48,111],[3,3,213,87,114,48,99,111],[207,207,213,87,165,48,99,111],
[3,54,162,87,165,252,99,111],[207,3,162,87,216,252,99,111],[3,3,213,87,165,48,252,111],[207,207,213,87,216,48,252,111],
[54,54,162,87,114,48,48,162],[3,156,162,189,114,48,48,162],[207,207,162,87,216,48,48,162],[3,207,213,87,114,99,48,162],
[207,3,213,138,165,201,48,162],[156,207,213,138,216,201,48,162],[207,207,9,138,114,252,48,162],[207,54,9,36,165,252,48,162],
[156,156,9,138,165,252,48,162],[3,207,111,189,165,252,48,162],[156,3,9,36,216,252,48,162],[3,54,111,87,216,252,48,162],
[3,207,162,138,114,48,99,162],[207,54,213,87,165,201,99,162],[156,3,213,87,216,201,99,162],[207,3,9,87,114,252,99,162],
[156,207,9,87,165,252,99,162],[3,3,111,138,165,252,99,162],[3,3,162,87,216,48,201,162],[3,207,213,87,165,99,201,162],
[54,3,162,138,114,48,252,162],[3,54,162,36,216,48,252,162],[207,156,162,138,216,48,252,162],[3,156,213,138,114,99,252,162],
[3,3,213,36,165,99,252,162],[207,3,9,87,165,252,252,162],[156,207,9,87,216,252,252,162],[3,3,111,138,216,252,252,162],
[207,207,9,87,114,48,48,213],[54,3,111,138,114,48,48,213],[3,207,111,138,165,48,48,213],[207,207,162,189,165,201,48,213],
[207,54,162,87,216,201,48,213],[3,54,213,87,114,252,48,213],[207,156,213,189,114,252,48,213],[156,207,213,87,216,252,48,213],
[207,3,162,138,165,201,99,213],[207,207,213,138,114,252,99,213],[207,207,9,87,165,48,201,213],[54,3,111,138,165,48,201,213],
[3,207,111,138,216,48,201,213],[54,207,162,138,114,99,201,213],[3,156,162,138,165,99,201,213],[207,3,213,87,216,252,201,213],
[207,156,9,138,114,48,252,213],[54,207,111,189,114,48,252,213],[207,3,9,36,165,48,252,213],[54,54,111,87,165,48,252,213],
[3,156,111,189,165,48,252,213],[3,3,111,87,216,48,252,213],[54,3,162,87,114,99,252,213],[3,207,162,87,165,99,252,213],
[207,3,162,138,216,201,252,213],[3,3,213,138,114,252,252,213],[207,54,213,36,216,252,252,213],[156,156,213,138,216,252,252,213]],
[[75,6,90,180,234,243,18,90],[75,159,192,180,234,243,18,90],[75,57,192,180,81,90,69,90],[75,6,243,180,81,90,69,90],
[228,159,192,78,81,192,69,90],[75,6,90,180,234,192,69,90],[75,108,243,180,234,192,69,90],[177,159,243,27,81,243,69,90],
[75,159,192,180,234,90,171,90],[75,108,243,180,234,90,171,90],[228,6,192,78,234,192,171,90],[75,159,90,180,81,243,171,90],
[75,57,192,180,81,243,171,90],[177,6,243,27,234,243,171,90],[75,159,90,180,81,192,222,90],[75,6,243,180,81,192,222,90],
[75,159,192,78,81,90,69,192],[177,6,90,180,234,90,69,192],[177,108,243,180,234,90,69,192],[75,108,90,78,234,192,69,192],
[75,6,192,78,234,192,69,192],[177,159,90,180,81,243,69,192],[75,6,192,78,234,90,171,192],[177,6,90,180,234,243,171,192],
[177,159,90,180,81,90,222,192],[177,6,243,180,81,90,222,192],[75,6,90,78,81,192,222,192],[75,159,192,78,81,192,222,192],
[228,6,90,180,234,90,18,243],[228,159,192,180,234,90,18,243],[75,159,90,27,234,243,18,243],[75,6,243,27,234,243,18,243],
[75,159,243,27,81,90,69,243],[228,159,90,180,81,192,69,243],[228,159,90,180,81,90,171,243],[228,57,192,180,81,90,171,243],
[75,6,243,27,234,90,171,243],[228,6,90,180,234,192,171,243],[75,57,90,27,81,243,171,243],[75,159,243,27,81,243,171,243]],
[[195,126,150,105,165,120,153,96],[195,24,150,105,165,222,153,96],[195,126,150,105,165,18,102,249],[195,24,150,105,165,120,102,249]],
[[132,192,6,114,45,114,51,33],[132,141,210,165,45,114,51,33],[132,141,57,63,96,114,51,33],[132,90,6,114,96,114,51,33],
[183,141,57,63,45,165,51,33],[183,39,210,165,45,165,51,33],[183,192,6,114,249,165,51,33],[183,90,159,216,249,165,51,33],
[234,141,210,165,198,216,51,33],[234,90,159,216,198,216,51,33],[234,90,6,114,249,216,51,33],[234,39,210,165,249,216,51,33],
[81,192,6,114,96,63,51,84],[81,141,210,165,96,63,51,84],[81,141,57,63,147,63,51,84],[81,90,6,114,147,63,51,84],
[183,141,57,63,45,165,51,84],[183,243,159,216,45,165,51,84],[183,39,108,12,249,165,51,84],[183,192,6,114,249,165,51,84],
[234,39,108,12,198,216,51,84],[234,141,210,165,198,216,51,84],[234,90,6,114,249,216,51,84],[234,243,159,216,249,216,51,84],
[234,141,210,165,198,12,204,84],[234,90,159,216,198,12,204,84],[234,90,6,114,249,12,204,84],[234,39,210,165,249,12,204,84],
[132,192,6,114,45,165,204,84],[132,141,210,165,45,165,204,84],[132,141,57,63,96,165,204,84],[132,90,6,114,96,165,204,84],
[183,141,57,63,45,216,204,84],[183,39,210,165,45,216,204,84],[183,192,6,114,249,216,204,84],[183,90,159,216,249,216,204,84],
[81,192,6,114,96,63,51,135],[81,90,159,216,96,63,51,135],[81,141,57,63,147,63,51,135],[81,39,210,165,147,63,51,135],
[132,39,108,12,45,114,51,135],[132,192,6,114,45,114,51,135],[132,141,57,63,96,114,51,135],[132,243,159,216,96,114,51,135],
[234,39,108,12,198,216,51,135],[234,90,159,216,198,216,51,135],[234,39,210,165,249,216,51,135],[234,243,159,216,249,216,51,135],
[234,39,108,12,198,12,204,135],[234,141,210,165,198,12,204,135],[234,90,6,114,249,12,204,135],[234,243,159,216,249,12,204,135],
[81,192,6,114,96,114,204,135],[81,141,210,165,96,114,204,135],[81,141,57,63,147,114,204,135],[81,90,6,114,147,114,204,135],
[183,141,57,63,45,216,204,135],[183,243,159,216,45,216,204,135],[183,39,108,12,249,216,204,135],[183,192,6,114,249,216,204,135],
[81,141,210,165,96,63,51,186],[81,90,159,216,96,63,51,186],[81,90,6,114,147,63,51,186],[81,39,210,165,147,63,51,186],
[132,39,108,12,45,114,51,186],[132,141,210,165,45,114,51,186],[132,90,6,114,96,114,51,186],[132,243,159,216,96,114,51,186],
[183,39,210,165,45,165,51,186],[183,243,159,216,45,165,51,186],[183,39,108,12,249,165,51,186],[183,90,159,216,249,165,51,186],
[234,39,108,12,198,12,204,186],[234,90,159,216,198,12,204,186],[234,39,210,165,249,12,204,186],[234,243,159,216,249,12,204,186],
[81,192,6,114,96,114,204,186],[81,90,159,216,96,114,204,186],[81,141,57,63,147,114,204,186],[81,39,210,165,147,114,204,186],
[132,39,108,12,45,165,204,186],[132,192,6,114,45,165,204,186],[132,141,57,63,96,165,204,186],[132,243,159,216,96,165,204,186],
[81,141,210,165,96,114,204,237],[81,90,159,216,96,114,204,237],[81,90,6,114,147,114,204,237],[81,39,210,165,147,114,204,237],
[132,39,108,12,45,165,204,237],[132,141,210,165,45,165,204,237],[132,90,6,114,96,165,204,237],[132,243,159,216,96,165,204,237],
[183,39,210,165,45,216,204,237],[183,243,159,216,45,216,204,237],[183,39,108,12,249,216,204,237],[183,90,159,216,249,216,204,237]]
];
&and[El2[i] eq NextEls1All[i,1]:i in [1..#NextEls1All]];

// Many of the conjugacy questions are difficult (i.e., take ages), so we provide elements that prove the conjugacy directly.
EE:=[
[E.3],
[E.2*E.3*E.1*E.4*E.3*E.5*E.4*E.2*E.6*E.5*E.4*E.2*E.3*E.1*E.7*E.6*E.5*E.4*E.2*E.3*E.1*E.4*E.3*E.5*E.6*E.7*E.8*E.7*E.6*E.5*E.4*E.2*E.3*E.1*E.4*E.3*E.5*E.4*E.2*E.6*E.5*E.4*E.3*E.1*E.7*E.6*E.5*E.4*E.2*E.3,
E.3*E.4*E.3*E.1*E.5*E.4*E.3*E.6*E.5*E.4*E.7*E.6*E.5*E.4*E.2*E.3*E.1*E.8*E.7*E.6*E.5*E.4*E.2*E.3*E.1*E.4*E.3*E.5*E.4*E.2*E.6*E.5*E.4*E.3*E.1*E.7*E.6*E.5*E.4*E.3*E.8*E.7*E.6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*E.3*E.7*E.6*E.5*E.4*E.3*E.1*E.8*E.7*E.6*E.5*E.4*E.2*E.3*E.1*E.4*E.3*E.5*E.4*E.2*E.6*E.5*E.4*E.3*E.1*E.7*E.6*E.5*E.4*E.2*E.3*E.4*E.5*E.6*E.8*E.7*E.6*E.5*E.4*E.2*E.3*E.1*E.4*E.3],
[E.6*E.5*E.4*E.3*E.1*E.7*E.6*E.5*E.4*E.2*E.3*E.4*E.5*E.6*E.7*E.8*E.7*E.6*E.5*E.4*E.2*E.3*E.1*E.4*E.3*E.5*E.4*E.6*E.5*E.7*E.6,
E.7],
[E.4*E.2*E.5*E.4*E.2*E.3*E.6*E.7*E.6*E.8*E.7*E.6*E.5*E.4*E.2*E.3*E.4*E.5,
E.4*E.2*E.5*E.6*E.7*E.8*E.7*E.6*E.5*E.4*E.2*E.3*E.1*E.4*E.3*E.5*E.4*E.2*E.6*E.5*E.4*E.3*E.1*E.7*E.6*E.5*E.4*E.2*E.3*E.4*E.5*E.6*E.7*E.8*E.7*E.6*E.5*E.4*E.2*E.3*E.1*E.4*E.3*E.5*E.4*E.2*E.6*E.5*E.4*E.3*E.1*E.7*E.6*E.5*E.4*E.2*E.3,
E.2*E.3*E.1*E.4*E.3*E.5*E.4*E.2*E.3*E.1*E.4*E.3*E.6*E.5*E.4*E.2*E.3*E.1*E.7*E.6*E.5*E.4*E.2*E.3*E.1*E.4*E.3*E.5*E.6*E.8*E.7*E.6*E.5*E.4*E.2*E.3*E.1*E.4*E.3*E.5*E.4*E.2*E.6*E.5*E.4*E.3*E.1*E.7*E.6*E.5*E.4*E.8*E.7*E.6
]
];

for OneToCheck in [1..#El1] do
  Els1:=ConstructPreimages([15*i:i in El1[OneToCheck]],255,5);
  E11:={*i[1]^^i[2]:i in Eigs1[OneToCheck]*};
  E1:={*R!(Log(i)):i in E11*};
  NextEls1:=[];
  for ii in [1..#Els1] do
    if E1 eq {*&+[Els1[ii,i]*X[i,j]:i in [1..8]]:j in [1..248]*} then Append(~NextEls1,Els1[ii]); end if;
  end for;
  El2[OneToCheck] eq NextEls1[1]; NextEls1All[OneToCheck] eq NextEls1;
end for;

for OneToCheck in [1..#NextEls1All] do
  NextEls1:=NextEls1All[OneToCheck];
  gg1:=ProduceGroupElements(T,NextEls1);
  Orbs:={{i}:i in [1..#NextEls1]};
  for e in EE[OneToCheck] do
    for i in [1..#NextEls1] do
      j:=Position(gg1,gg1[i]^e);
      Orb1:=FindOrb(Orbs,i);
      if(not(j in Orb1)) then
        Orb2:=FindOrb(Orbs,j);
        Exclude(~Orbs,Orb1);
        Exclude(~Orbs,Orb2);
        Include(~Orbs,Orb1 join Orb2);
        delete Orb1; delete Orb2; if(#Orbs eq 1) then "Case",OneToCheck,"all conjugate"; break e; end if;
      end if;
    end for;
  end for;
  delete NextEls1;
  delete gg1;
end for;

"Now checking how many elements of order 255 there are with the correct number of eigenvalues";
NextEls2All:=[];
for OneToCheck in [1..#Eigs1] do
  Els2:=ConstructPreimages(NextEls1All[OneToCheck,1],255,3);
  NextEls2:=[];
  for ii in [1..#Els2] do
    if #Eigs1[OneToCheck] eq #{&+[Els2[ii,i]*X[i,j]:i in [1..8]]:j in [1..248]} then Append(~NextEls2,Els2[ii]); end if;
  end for;
  Append(~NextEls2All,NextEls2);
  [#i-1:i in NextEls2All]; //remove element of order 85
end for;

"Now test eigenvalues for specific modules for tenth case";

EigsToTest1:=[EigenvaluesOfElement(ChangeRing(Irr2[i],F),x):i in [1..30]];
EigsToTest2:=[{R!Log(i[1]):i in j}:j in EigsToTest1];

Els2:=ConstructPreimages(El2[10],255,3);
EigEls2:=[{*&+[ii[i]*X[i,j]:i in [1..8]]:j in [1..248]*}:ii in Els2];
EigMults2:=[{*i*3:i in MultisetToSet(j)*}:j in EigEls2];
WhatMults:=[{i:i in j|Multiplicity(j,i) eq 1}:j in EigMults2];
for j in [1,6,7,10,11,14,15,16,17,24,25,30] do j,#[i:i in WhatMults|EigsToTest2[j] subset i]-1; end for; //subtract element of order 85

"Now checking the radical mentioned in Case 10";

IrrSome:=[S1,S912,S912d,S914,S914d,S924,S924d,S934,S934d,S27124,S27124d];
labs:=["1","9_{1,2}","9_{1,2}^*","9_{1,4}","9_{1,4}^*","9_{2,4}","9_{2,4}^*","9_{3,4}","9_{3,4}^*","27_{1,2,4}","27_{1,2,4}^*"];

for i in [S1,S912,S914,S924,S934,S27124] do Dimension(Ext(S6424,i)) eq 0; end for;

A1:=S27124d; for i in [S912,S924d,S1,S914,S924,S934,S924d] do E,rho:=Ext(A1,i); A1:=MaximalExtension(A1,i,E,rho); DescribeLayers(Dual(A1),IrrSome,labs); end for;

for i in [S1,S912,S912d,S914,S914d,S924,S924d,S934,S934d] do Dimension(Ext(A1,i)) eq 0; end for;
