How did the United States acquire the Louisiana Purchase?

A.
Buying it from France.

B.
Exchanging other territory for it with Spain.

C.
Buying it from Great Britain.

D.
Fighting a war with Mexico.