The water on Mars didn't run dry all at once, study finds