Input (grade 6): Melbourne was Prime Minister when Queen Victoria came to the throne (June 1837).
Output (grade 8): Melbourne was Prime Minister when Queen Victoria became queen.