An element X combines with oxygen to form a compound of formula XO2. If 24.0 grams of element X combines with exactly 16.0 grams of O to form this compound, what is the atomic weight of element X?