How the ancient philosophers imagined the end of the world