The ancient Egyptians viewed men and women, including people from all social classes except slaves, as essentially equal under the law, and even the lowliest peasant was entitled to petition the vizier and his court for redress. Both men and women had the right to own and sell property, make contracts, marry and divorce, receive inheritance, and pursue legal disputes in court. Married couples could own property jointly and protect themselves from divorce by agreeing to marriage contracts, which stipulated the financial obligations of the husband to his wife and children should the marriage end. Women such as Hatshepsut and Cleopatra even became pharaohs, while others wielded power as Divine wives of Amun . Despite these freedoms, ancient Egyptian women did not take part in official roles in the administration, served only secondary roles in the temples, and were not as likely to be as educated as men.