Let $R$ be a UFD.Let $a,b \in R$ where $a = {p_{1}}^{r_{1}}.{p_{2}}^{r_{2}}...{p_{n}}^{r_{n}}$ and $b = {p_{1}}^{s_{1}}{p_{2}}^{s_{2}}...{p_{n}}^{s_{n}}$, where $r_{i},s_{i} \in \mathbb N_{0}$ ,$p_i$'s are irreducible in $R$ and $p_{i}$ is not an associate of $p_{j}$ if and only if $i \neq j$.Then show that $d = {p_{1}}^{t_{1}}{p_{2}}^{t_{2}}...{p_{n}}^{t_{n}}$, is the gcd of $a$ and $b$, where $t_{i} = \min \{r_{i},s_{i} \}$.
My attempt :
First of all it can be easily observed that $d$ divides both $a$ and $b$.
Let $x$ be a common divisor of $a$ and $b$.
Let $k_i$ be the highest power of $p_i$ such that ${p_{i}}^{k_{i}}|x$.If $k_i > r_i$ then I think ${p_{i}}^{k_{i}}$ does not divide $a$.Though I fail to prove it.If I assume it then it is quite simple to prove that $x|d$ which proves the result.Please help me in showing ${p_{i}}^{k_{i}}$ does not divide $a$.Then I can do the remaining part.
Thank you in advance.