Artificial intelligent assistant

Show that $\text{ord}_n (ab) \mid \text{ord}_n (a) \cdot \text{ord}_n (b)$ when $(a,n)=(b,n)=1$ and $(\text{ord}_n (a), \text{ord}_n (b)) = 1$. The question is to show that if $n$ is a positive integer with $(a,n)=(b,n)=1$ and $(\text{ord}_n (a), \text{ord}_n (b)) = 1$, then $\text{ord}_n (ab) \mid \text{ord}_n (a) \cdot \text{ord}_n (b)$. I am given the following solution: $$(ab)^{\text{ord}_n a \cdot \text{ord}_n b} \equiv (a^{\text{ord}_n a})^{\text{ord}_n b}(b^{\text{ord}_n b})^{\text{ord}_n a} \equiv 1 \pmod n$$ Could somebody explain how this implies that $\text{ord}_n (ab) \mid \text{ord}_n (a) \cdot \text{ord}_n (b)$? I am unable to connect the dots.

Again, $(ab)^{\text{ord}_n(ab)}\equiv1\pmod n$

Now if $c^m\equiv1$ and let $m=q\cdot\text{ord}_nc+r\ \ \ \ (1)$ where $0\le r<\text{ord}_nc$

$c^m=(c^{\text{ord}_nc})^q\cdot c^r$

$\implies1\equiv1^q\cdot c^r\pmod n\implies c^r\equiv1$

But by definition $\text{ord}_nc$ is the smallest positive integer value of $u$ such that $c^u\equiv1$

$\implies r=0,$ use this in $(1)$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy a567820194713d30401e2c904001d06d