pi=4*a(1)
w1=2*c(2*pi/9)
w2=2*c(8*pi/9)
w3=2*c(32*pi/9)

w1^3 - 3*w1 + 1
w2^3 - 3*w2 + 1
w3^3 - 3*w3 + 1

w2-(-(w1^2)-w1+2)
w3-(-(w2^2)-w2+2)
w1-(-(w3^2)-w3+2)

w3-(w1^2-2)
w1-(w2^2-2)
w2-(w3^2-2)

s1= sqrt(2)
s2= -sqrt(2)

limit=5;

for(e00=-limit;e00<=limit;e00++)
  for(e01=-limit;e01<=limit;e01++)
    for(e10=-limit;e10<=limit;e10++)
      for(e11=-limit;e11<=limit;e11++)
        for(e20=-limit;e20<=limit;e20++)
          for(e21=-limit;e21<=limit;e21++) {
            x11=(e00+e01*s1)+(e10+e11*s1)*w1+(e20+e21*s1)*w1^2
            x12=(e00+e01*s2)+(e10+e11*s2)*w1+(e20+e21*s2)*w1^2
            x21=(e00+e01*s1)+(e10+e11*s1)*w2+(e20+e21*s1)*w2^2
            x22=(e00+e01*s2)+(e10+e11*s2)*w2+(e20+e21*s2)*w2^2
            x31=(e00+e01*s1)+(e10+e11*s1)*w3+(e20+e21*s1)*w3^2
            x32=(e00+e01*s2)+(e10+e11*s2)*w3+(e20+e21*s2)*w3^2
	    if(x12<0 || x22<0 || x32<0)continue
	    if(x11>0 && x21>0 && x31>0)continue
	    if(x11<0 && x21<0 && x31<0)continue
            print "[", \
              e00,",",e01,",",e10,",",e11,",",e20,",",e21, \
              "],\n";
          }  
