How was the Song dynasty able to continue its prosperity despite threats from the north?

A. More productive farming created a surplus of food, which could be sold.
B. The government's issuance of paper money created more wealth.
C. Technological innovations such as gunpowder and the compass led to industrialization
D. The Great Wall and the Grand Canal allowed major cities to remain unoccupied