Input (grade 4): Obama served three terms in the Illinois Senate from 1997 to 2004.
Output (grade 3): He was state senator from 1997 to 2004.