R a commutative ring and A an ideal in R with $A=m_1···m_r=n_1···n_s$ with $m_i$ distinct maximal ideals and all the $n_j$ distinct maximal ideals.

Let R be a commutative ring and A be an ideal in R satisfying $ A=m_1···m_r =n_1···n_s$ with all the $ m_i$ distinct maximal ideals and all the $ n_j$ distinct maximal ideals. Show that $ r = s$ and there exists a $ σ ∈ Sr$ satisfying $ m_i = n_σ(i)$ for all i.

I know that maximal ideal implies it being prime, and the product is contained in $ m_i$ and $ n_j$ for all $ i$ and $ j$ , but I’m not sure how to proceed further.