Input (grade 8): John Quincy Adams was elected a member of the Massachusetts State Senate in April 1802.
Output (grade 4): In 1802 he was elected to the United States Senate.