Given the task definition and input, reply with output. Given a passage and a query based on the passage, generate an unambiguous, concise and simple answer to the query from information in the passage. Note that the answer may not be present in exact form.

She took throne after her father's death at fifty six. Maria Theresa took over the territories when she was twenty six. Maria Theresa was the only woman to take the leadership position in over 600 years. Before Charles IV's death, he was the last remaining male of the Hapsburg dynasty. The last woman as a leader was during the Hapsburg family's dynasty. Maria Theresa (1717-1780). Habsburg Empress, Co-Regent of the Empire. Without male heirs, Charles IV altered Habsburg family law by the Pragmatic Sanction of 1713, which proclaimed the indivisibility of his lands and designated his eldest daughter, Maria Theresa, as his successor. Maria Theresa did so many good things for Austria and that is what made her such a great ruler. When Fredrick the Great heard about the death of her, he stated, This woman's achievements were those of a great man. In 1741, another claimant to the Austrian throne appeared, one Charles Albert, Elector of Bavaria, who was elected Charles VII in Frankfurt the following year. Maria Theresa was forced to cede Lower Silesia to Prussia in 1741, then the entire province in 1742. With the Peace of Aix-la-Chapelle in 1748, the Habsburgs lost Parma, Piacenza, Guastalla, and the Milanese territories west of the Ticino. Maria Theresa Walburga Amalia Christina[1] (German: Maria Theresia [maia teezia]; 13 May 1717 29 November 1780) was the only female ruler of the Habsburg dominions and the last of the House of Habsburg. Maria Theresa took over the territories when she was twenty six. Maria Theresa was the only woman to take the leadership position in over 600 years. Before Charles IV's death, he was the last remaining male of the Hapsburg dy nasty. The last woman as a leader was during the Hapsburg family's dynasty. Maria Theresa Walburga Amalia Christina (German: Maria Theresia; 13 May 1717 29 November 1780) was the only female ruler of the Habsburg dominions and the last of the House of Habsburg. She was the sovereign of Austria, Hungary, Croatia, Bohemia, Transylvania, Mantua, Milan, Lodomeria and Galicia, the Austrian Netherlands and Parma. rming laws as an enlightened monarchy. In 1774, they introduced mandatory education. In 1780, Maria Theresa passed away in Vienna. She was the only woman who ruled in the 650-year-long Hapsburg dynasty. Her son, Joseph II, took rule after her death. Maria Theresa ruled for forty years the wide empire of Austria. Maria Theresa's first challenge was Prussia. They tried to occupy Silesia after the death of her father. Maria Theresa was born on May 13, 1717 in Vienna, Austria. She was the oldest child of Charles IV and Elizabeth of Brunswick-Wolfenbttl. She married her cousin, Francis of Lorraine. He later became duke of Tuscany and then emperor. Query: how long did maria theresa rule
Maria Theresa ruled for forty years.