Groebner rings