In a situation in which you have the same number of molecules, therefore the same number of moles in three different compounds, and three different masses, the reason for that is because their molecular formulas are different, that means that they are composed of different elements or same elements in a different quantity, and because of that the final weight will be different among the three compounds