Input (grade 12): Democrat Barack Obama, then junior United States Senator from Illinois, defeated Republican John McCain.
Output (grade 12): Barack Obama from the Democratic Party defeated John McCain to win the presidency, and is the first African-American president.