 From the time of their introduction into Japan, Confucian political, social, and ethical ideals quickly transformed the structure of Japanese society. From the seventh century, texts traditionally associated with Confucianism served as the core curriculum in the imperial academy for the education of courtiers and bureaucratic officials. Politically, Confucian ideology gave a sophisticated justification for an imperial state. Like proto-Shintō, it recognized the charisma of the political ruler as both a chief ritual priest and mediator with the celestial realm as well as the pinnacle of political authority. But Confucianism added to the Japanese context a rich description of political and social roles that organized the society into a harmonious network of interdependent offices and groups. Confucianism defined a place for each person and a set of shifting roles and contexts to be performed with ritual decorum.