list_lines(p)= {
local(a,b,c,d);
(L(a,b,c,d)= a*W+b*X+c*Y+d*Z);

a=1;
for(b=0, p-1,
  for(c = 0, p-1,
    for(d = 0, p-1,
      print(L(a,b,c,d)"=0") 
    ) 
  )
);

a=0;
b=1;
for(c=0, p-1,
  for(d=0, p-1,
    print(L(a,b,c,d)"=0")
 )
);

a=0;
b=0;
c=1;
for(d=0, p-1,
  print(L(a,b,c,d)"=0")
);

a=0;
b=0;
c=0;
d=1;
print(L(a,b,c,d)"=0")
}