Let $K$ be a field and $R_1,\dots,R_n$ DVRs of $K$ with $m_i$ the maximal ideal of $R_i$ and $R_i \not\subseteq R_j$ for $j\neq i$ . Define $A=\bigcap_{i=1}^n R_i$. Then $A$ is semilocal with maximal ideals $p_i=m_i\cap A$. Also, $A_{p_i}=R_i$.
I know there is an $x_i \in p_i$ such that $x_i \not\in p_j$ for $i \neq j$ and $x_i \not\in p_i^2 A_{p_i}\cap A$.
Question: Why is $p_i=x_iA$?
I know $p_1,\dots,p_n$ are (pairwise) coprime and so are $p_1,\dots,p_{i-1}, p_i^2, p_{i+1},\dots,p_n$, but Matsumura's argument is unclear to me.
Reference: Theorem 12.2 in Matsumura, Commutative Ring Theory.