text: The Tang and the Song dynasty saw a major transition in the composition of China's ruling elites. From the Han through the Tang, official posts filled by an aristocratic network of several hundred intermarried families based in the capital. Many of them were prominent for 500 years or more, far longer than European feudal dynasties. From the Song on, however, official posts were usually filled by a much larger but less cohesive class of gentry who married and owned property in their home provinces and who rose to prominence through the examination system. Scholarly explanations for the demise of the old class and the rise of the new include Empress Wu's decision to promote newly risen bureaucrats, reforms that followed the An Lushan rebellion, the destruction of aristocratic families in the Huang Chao rebellion, and decisions taken by the families themselves in the Song dynasty to build up local power bases.
  Song dynasty
  During the Song dynasty social strata were clearly divided and enforced by the law. At the bottom of the pyramid were the commoners who were categorized into two groups: Fangguo Hu (city dwellers) and Xiangcun Hu (rural population). Fangguo Hu and Xiangcun Hu had ranks. The first rank, commoners (both Fangguo and Xiangcun), were the wealthiest. The ranks of commoners could change over time, as one who acquired more wealth could be promoted to a higher rank.