Sequential star formation in the Magellanic Clouds