#a = 677330545177305025495135714080
#b = 14269972710765292560
#p a % b  #=> 0
#p -a % b #=> 14269972710765292560

require "groebner-basis"
#require "mathn"
require "rational"
#require "residue-class-ring"
#F = ResidueClassRing.create(17123, Fixnum)
#w, x, y, z = MPolynomial.vars("wxyz", F)
w, x, y, z = MPolynomial.vars("wxyz", Rational)
f0 = 3*x**2 + 2*y*z - 2*x*w
f1 = 2*x*z - 2*y*w
f2 = 2*x*y - 2*z - 2*z*w
f3 = x**2 + y**2 + z**2 - 1
fs = [f0, f1, f2, f3]
puts fs
puts "------"
puts Groebner.basis(fs).rsort
