Input (grade 7): Mary reigned jointly with her husband and first cousin, William III and II, who became sole ruler upon her death in 1694.
Output (grade 3): Mary ruled together with her husband, William III and II. He became the ruler of both countries when she died in 1694.