Emperor of China (Chinese: 皇帝; realized as Qin Shi Huáng dì in Standard Chinese) is the title given the monarch of China during the imperial period of Chinese history. In traditional Chinese political theory, the Emperor was considered the Son of Heaven and the autocrat of All under Heaven. Under the Han dynasty, Confucianism replaced Legalism as the official political theory and succession theoretically followed agnatic primogeniture. The Chinese emperors who shared the same family were classified into historical periods known as dynasties. The absolute authority of the emperor was notionally bound with various duties and obligations; failure to uphold these was thought to remove the dynasty's Mandate of Heaven and to justify its replacement. In practice, emperors and heirs sometimes avoided the strict rules of succession and dynasties' ostensible "failures" were detailed in official histories written by their successful replacements. The power of the emperor was also often limited by the imperial bureaucracy staffed by scholar-officials and eunuchs and by filial obligations to surviving parents and to dynastic traditions, such as those detailed in the Ming dynasty's Ancestral Instructions.