F:=FreeGroup(4);;w:=F.1;;x:=F.2;;y:=F.3;;z:=F.4;;
rels:=[w^8, w*x*w*(x*w*x)^-1, y^2, z*x*(x*z)^-1,
       z^-1*y*z*y, (x*y*x)^2];;
G:=F/rels;;
N2:=[];;N3:=[];;
for u in GeneratorsOfGroup(G) do
 Add(N2,u^2);
 Add(N3,u^3);
 for v in GeneratorsOfGroup(G) do
 Add(N2,Comm(u,v));
 Add(N3,Comm(u,v));
 od;;od;;
N2:=NormalClosure(G,Group(N2));;
N3:=NormalClosure(G,Group(N3));;
Print(AbelianInvariants(N2),"\n");
Print(AbelianInvariants(N3),"\n");
