query: Who was president in 1817?
passage: James Monroe
James Monroe (/mənˈroʊ/; April 28, 1758 – July 4, 1831) was an American statesman and Founding Father who served as the fifth president of the United States from 1817 to 1825. He is perhaps best known for his foreign policy principle, known as the "Monroe Doctrine", which prohibited further European colonization of the Americas (beginning in 1823). Monroe was the last president of the Virginia dynasty, and his presidency ushered in what is known as the Era of Good Feelings. Born in Westmoreland County, Virginia, Monroe was of the planter class and fought in the American Revolutionary War. He was wounded in the Battle of Trenton with a musket ball to the shoulder. After studying law under Thomas Jefferson from 1780 to 1783, he served as a delegate in the Continental Congress.[1]
passage: Presidency of John Quincy Adams
The presidency of John Quincy Adams began on March 4, 1825, when John Quincy Adams was inaugurated as President of the United States, and ended on March 4, 1829. Adams, the sixth United States president, took office following the 1824 presidential election, in which he and three other Democratic-Republicans—Henry Clay, William H. Crawford, and Andrew Jackson—sought the presidency. No candidate won a majority of Electoral College votes, and so the United States House of Representatives chose the president in a contingent election. With the help of Clay, Adams was elected by the House, and Clay became Adams's Secretary of State.