Let $M$ be a finitely generated torsion module over a Dedekind domain $R$. Show that there exist nonzero ideals $I_1 \supseteq \cdots \supseteq I_n$ of $R$ such that $M \cong \bigoplus\limits_{i=1}^n R/I_i$.
I'm stuck on this problem. Since $M$ is torsion and finitely generated, the annhilator $\mathfrak a:= \textrm{ann}_RM$ of $M$ is a nonzero ideal, which we can write as a product of primes $P_1^{e_1} \cdots P_s^{e_s}$. The hint given in the problem is to show that $S^{-1}R$ is a principal ideal domain, where $S = R \setminus (P_1 \cup \cdots \cup P_s)$.
This is pretty clear, since the localization of a Dedekind domain remains a Dedekind domain, and the prime avoidance theorem plus the fact that every prime ideal is maximal implies that $S^{-1}P_1, ... , S^{-1}P_s$ are the only prime ideals of $S^{-1}R$. And a semilocal Dedekind domain is automatically a principal ideal domain.
Now $S^{-1}M$ is a finitely generated $S^{-1}R$-module, so we can apply the structure theorem for finitely generated modules over PIDs: there exist $d_1, ... , d_n \in S^{-1}R$ such that $Rd_1 \supseteq \cdots \supseteq Rd_n$ and $$S^{-1}M \cong \bigoplus\limits_{i=1}^n \frac{S^{-1}R}{S^{-1}Rd_i}$$ Also if we let $S^{-1}Rp_i = S^{-1} P_i$, then the principal ideals $S^{-1}Rd_i$ are localizations of ideals $I_i$ of $R$, where we can ensure that the localization of $I_i$ at $S$ is $(d_i)$, as long as $\nu_{P_j}(I_i) = \nu_{P_j}(d_i)$ for $j = 1, ... , n$. That's nice, but I don't know how to relate the localized module $S^{-1}M$ to the original module $M$. Any hints would be appreciated.