That's why it's recommended to combine a half dose of ibuprofen and a half dose of paracetamol at the same time. (Plus some vitamin C)
Together they have higher pain killung effects than each alone, and the side effects are reduced as they affect different body parts. And the vitamin C reduces the damage to the stomach lining.