Check the final answer first, then review the worked steps.
$$\frac{5f^3g^{16}}{f^{12}g^4} = 5f^{3-12}g^{16-4} = 5f^{-9}g^{12} = \frac{5g^{12}}{f^9}$$