Let R be a PID and M an R-module that is annihilated by the nonzero proper ideal (a) (the ideal generated by a).

Let a=(p_1)^(b_1) * (p_2)^(b_2) * ... * (p_k)^(b_k)
be the unique factorization of a into distinct prime powers in R. Let M_i be the annihilator of (p_i)^(b_i). (so M_i={m in M|p_i^(b_i) * m = 0}

Prove that M is = to the direct sum of all M_i, from i=1 to k.

I can't figure out how to prove that because the tuples are annihilated, the whole thing is annihilated. Also I can't figure out why just because a module is annihilated by an ideal, it is uniquely determined.