How would one factor a product of two primes (n), if they know both n and phi(n)?
Let $\displaystyle n = p_1p_2 \ \Leftrightarrow \ p_2 = \frac{n}{p_1} \qquad {\color{red}\star}$.
Then: $\displaystyle \varphi (n) = \varphi (p_1p_2) = \varphi(p_1)\varphi(p_2) = (p_1 - 1)(p_2 - 1)$
So we have: $\displaystyle \varphi (n) = (p_1 - 1) (\frac{n}{p_1}-1)$ by $\displaystyle {\color{red}\star}$
All that we have to do now is solve for $\displaystyle p_1$.