First figure out how much carbon there is per mole of the substance X:
Then one mole of carbon is
So we have
Do the same with hydrogen:
Now for the tricky part. When chemists report an elemental analysis and it adds up to less than 100%, the difference is generally attributed to oxygen. Our analytical methods, constrained by working in an oxygenated and water-laden world, do not in general detect or measure oxygen directly. Instead we infer it by difference after accounting for the other elements.
Here we found that
So one mole of X contains four moles of oxygen to go with eight moles of carbon and 16 miles of hydrogen. Thus