Which of these sentences is punctuated correctly?

(1 point)
John Quincy Adams (1767-1848) was the sixth president of the United States.
John Quincy Adams [1767-1848] was the sixth president of the United States.
John Quincy Adams, 1767-1848, was the sixth president of the United States.
John Quincy Adams—1767-1848— was the sixth president of the United States.

John Quincy Adams (1767-1848) was the sixth president of the United States.