The Northern and Southern dynasties () was a period of political division in the history of China that lasted from 420 to 589, following the tumultuous era of the Sixteen Kingdoms and the Eastern Jin dynasty. It is sometimes considered as the latter part of a longer period known as the Six Dynasties (220–589). Albeit an age of civil war and political chaos, it was also a time of flourishing arts and culture, advancement in technology, and the spread of Mahayana Buddhism and Daoism. The period saw large-scale migration of the Han people to the lands south of the Yangtze. The period came to an end with the unification of all of China proper by Emperor Wen of the Sui dynasty. During this period, the process of sinicization accelerated among the non-Han ethnicities in the north and among the indigenous peoples in the south. This process was also accompanied by the increasing popularity of Buddhism (introduced into China in the 1st century) in both northern and southern China and Daoism gaining influence as well, with two essential Daoist canons written during this period. Notable technological advances occurred during this period. The invention of the stirrup during the earlier Jin dynasty (266–420) helped spur the development of heavy cavalry as a combat standard. Historians also note advances in medicine, astronomy, mathematics, and cartography. Intellectuals of the period include the mathematician and astronomer Zu Chongzhi (429–500), and astronomer Tao Hongjing. Background After the collapse of a unified China proper under the Eastern Han dynasty in 220 due in large part to the Yellow Turban and the Five Pecks of Rice rebellions, China eventually coalesced into the Three Kingdoms. Of these, Cao Wei was the strongest, followed by Eastern Wu and Shu Han, but they were initially in a relatively stable formation. After a 249 coup by Sima Yi, the Sima family essentially controlled Cao Wei and the conquest of Shu Han by Cao Wei rapidly followed. Following a failed coup by the ruling Cao family against the Sima family, the final Cao ruler abdicated. Sima Yan (Emperor Wu of Jin) then founded the Western Jin dynasty and the conquest of Eastern Wu by Western Jin occurred in 280, ending the Three Kingdoms period and reuniting China proper. The Western Jin dynasty was severely weakened after the War of the Eight Princes from 291 to 306. During the reigns of Emperor Huai of