according to the ancient story of the flood , after deucalion , son of prometheus , and his wife pyrrha drifted to safety over the surface of the waters , they repopulated the earth by throwing stones over their shoulders .