I am so sorry for being this late, but I recently had to solve this problem too.

If you look at the equation \((a^mx-a^n)(a^py-a^2)=a^4b^4\), you may notice that you can factor the previous equation to be in this form.

First, you distribute \(a^4\)into the parentheses to get \(a^4b^4 - a^4\). If you look at the other equation, you may see that their answer is very similar to \(a^4b^4 - a^4\). So, you first add \(a^4\) to both sides to get \((a^3x-a^2)(a^4y-a^2)=a^4b^4\). Factoring the left side gives \((a^3x-a^2)(a^4y-a^2)=a^4b^4\). So, \((m,n,p)=(3,2,4)\), which means \(mnp=3\cdot2\cdot4=\boxed{24}\).