How did Euclid and Pythagoras make in impacts of society in ancient times?