Let \( G \) be a finite abelian group, and suppose that \( G \) acts on the polynomial ring \( S = k[x_1, \ldots, x_n] \) via characters, i.e., suppose that for each \( i = 1, \ldots, n \) there exists a homomorphism \( \alpha_i : G \rightarrow k^times \), with \( k^times \) being the multiplicative group of \( k \), such that \( g \cdot x_i = \alpha_i(g) x_i \) for all \( g \in G \). Show that the invariants of the action of the group \( G \) are generated by those monomials \( \prod_{i=1}^n x_i^{a_i} \) whose exponent vectors \( (a_1, \ldots, a_n) \) belong to the kernel of an application of \( \mathbb{Z}^n \) to a certain finite abelian group. Conclude that the ring of invariants \( S^G \) is isomorphic to the field of rational functions in \( n \) variables.