Simplify (g^8h^2m)/(hg^7)