One legend concerning Asmodeus (see: ) goes on to state that Solomon one day asked Asmodeus what could make demons powerful over man, and Asmodeus asked to be freed and given the ring so that he could demonstrate; Solomon agreed but Asmodeus threw the ring into the sea and it was swallowed by a fish. Asmodeus then swallowed the king, stood up fully with one wing touching heaven and the other earth, and spat out Solomon to a distance of 400 miles. The Rabbis claim this was a divine punishment for Solomon's having failed to follow three divine commands, and Solomon was forced to wander from city to city, until he eventually arrived in an Ammonite city where he was forced to work in the king's kitchens. Solomon gained a chance to prepare a meal for the Ammonite king, which the king found so impressive that the previous cook was sacked and Solomon put in his place; the king's daughter, Naamah, subsequently fell in love with Solomon, but the family (thinking Solomon a commoner) disapproved, so the king decided to kill them both by sending them into the desert. Solomon and the king's daughter wandered the desert until they reached a coastal city, where they bought a fish to eat, which just happened to be the one which had swallowed the magic ring. Solomon was then able to regain his throne and expel Asmodeus. The element of a ring thrown into the sea and found back in a fish's belly also appeared in Herodotus' account of Polycrates, the tyrant of Samos (c. 538–522 BCE).