construct the invariant ring of a finite group