Greatest common factor of monomials