The exercise is
Let $a \geq 1$ and $b \geq 1$ be integers. Show that there exist integers $u \geq 1$ and $v \geq 1$ such that $u \mid a$ and $v \mid b$, $\gcd(u,v)=1$, and $\text{lcm}(u,v)=ab$.
We have $\gcd(u, v) =1$ so $u$ and $v$ are relatively prime, and $u \mid a$ and $v \mid b$ so $u$ and $v$ must be divisors of $a$ and $b$ with prime factors belonging exclusively to $a$ and $b$. From the fact that $\gcd(u,v) \text{lcm}(u,v) = uv$ it follows that $uv=ab$ so the product of two relatively prime numbers must be $ab$. But what if $a$ and $b$ share a factor greater than $1$?
For example, say that $a=3 \cdot 5 \cdot 7$ and $b= 5 \cdot 17 \cdot 19$. If we must find a $u$ and $v$ satisfying the conditions above. We have $uv = ab = 3 \cdot 5^2 \cdot 7 \cdot 17 \cdot 19 = 169575$. So to choose a $u$ and $v$ such that $u \mid a$, $v \mid b$ and $uv=ab$ we can simply let $u=a$ and $v=b$. But $\gcd(u,v) = \gcd(a,b) = 5$. That obviously won't work. Ok, what if we group the fives into one of them so $\gcd(u,v)=1$, let's say $u$? Then $u \nmid a$. And so on.
It seems like it's impossible to choose such a $u$ and $v$ unless $a$ and $b$ are relatively prime. Is this a mistake or am I doing this incorrectly?