In the year 2007, an estimated amount of 31 billion tons of carbon dioxide was emitted worldwide due to fossil fuel combustion and cement production. Express this mass of carbon dioxide in grams without exponential notation, using an appropriate metric prefix.