Neighbours6:=function(G,U,w) local x,y,z,i,h,L,S; L:=[]; S:=[]; for x in U do y:=[]; for i in [1..5] do y[i]:=w[x[i]]; od; if Size(Set(y))=5 then h:=RepresentativeAction(G,x,y,OnTuples); z:=OnTuples([1..12],h); if DistanceVecFFE(z,w)<=6 and IsSubset(L,[z])=false then Add(L,z); fi; if DistanceVecFFE(z,w)<=6 and IsSubset(S,[DistanceVecFFE(z,w)])=false then Add(S,DistanceVecFFE(z,w)); fi; fi; od; return [L,S]; end; Colour6:=function(G,U,w,red,yellow,green) local L,S,LS; LS:=Neighbours6(G,U,w); L:=LS[1]; S:=LS[2]; if Minimum(S)<6 then Add(red,w); else if Size(L)=1 then Add(green,w); else Add(yellow,w); fi; fi; end;