Lets define $ord_m n = k$ to mean that $k$ is the highest integer power (could be $0$) so that $m^k|n$ but for all $j > k$, $m^j\not \mid n$.
Now if we have two naturals $W$ and $U$ and they have unique prime factorizations, then if $W\ne U$ there will be some prime $p$ where $ord_p W \ne ord_p U$. But if $W = U$ then every prime $p$ will be so that $ord_p W= ord_p U$.
I claim that if $ab =cd$ then for any possible prime $p$ then $ord_p a = ord_p \frac {\gcd(a,c),\gcd(a,d)}{\gcd(a,b,c,d)}$, and therefore that $a = \frac {\gcd(a,c),\gcd(a,d)}{\gcd(a,b,c,d)}$.
Pf: Let $p$ be a prime.
Wolog we may assume $ord_p c \le ord_p d$.
Some basic facts about $ord_p$: $ord_p mn = ord_p m + ord_p n$ and $ord_p \gcd(m,n) = \min(ord_p m, ord_p n)$.
Now as $ab = cd$ we have $ord_p a + ord_p b = ord_p c + ord_p d$ or $ord_p b= ord_pc + ord_pd-ord_a$.
And $ord_p \frac {\gcd(a,c)\times \gcd(a,d)}{\gcd(a,b,c,d)} =$
$\min(ord_p a,ord_p c)+ \min(ord_p a,ord_p d) - \min(ord_p a,ord_p b,ord_p c,ord_p d)$.
Case 1: $ord_p a \le ord_p c \le ord_p d$. But that means $ord_p b= ord_d + (ord_c-ord_a) \ge ord_p d$
So $\min(ord_p a,ord_p c)+ \min(ord_p a,ord_p d) - \min(ord_p a,ord_p b,ord_p c,ord_p d)=$
$ord_p a + ord_p a - ord_p a = ord_p a$.
Case 2: $ord_p c < ord_p a \le ord_p d$. But that means $ord_p b = ord_pc + (ord_pd - ord_p a)\ge ord_p c$.
So $\min(ord_p a,ord_p c)+ \min(ord_p a,ord_p d) - \min(ord_p a,ord_p b,ord_p c,ord_p d)=$
$ord_p c + ord_p a - ord_p c = ord_p a$.
Case 3: $ord_p c \le ord_p d < ord_p a$. But that mesn $ord_p b = ord_p c + (ord_p d - ord_p a) < ord_p c$.
So $\min(ord_p a,ord_p c)+ \min(ord_p a,ord_p d) - \min(ord_p a,ord_p b,ord_p c,ord_p d)=$
$ord_p c + ord_p d - ord_p b = ord_p a$.
And that's it.