re word this:
The administrative structures of the Tang and Song dynasties in China were both centralized and bureaucratic. The Tang dynasty had three departments and a nine-rank system for officials, while the Song dynasty had three branches and a merit-based civil service examination system. This unique system allowed individuals to compete for government positions based on their knowledge and skills. Overall, both dynasties had centralized and bureaucratic systems, but the Song dynasty's merit-based system set it apart and contributed to its success.