Input (grade 9): When William III died in 1702, he was succeeded by Anne, and she in turn was succeeded by the son of the deceased Electress Sophia, George I.
Output (grade 3): When William III died in 1702, he was succeeded by Anne. She was succeeded by the son of Electress Sophia, George I.