In 710 Empress Genmei moved the capital to Heijō-kyō (Nara), laid out on the grid of Tang Chang'an; Japan entered the full maturity of the ritsuryō state. The Taihō and Yōrō codes fixed the two-department, eight-ministry government, the province-district-village structure, and public land with public citizens, the handen allotment system operating nationwide. Missions to Tang (among them Abe no Nakamaro and Kibi no Makibi) and student monks (Genbō) crossed constantly, and Chinese culture deeply shaped the capital and its offices. The official histories Kojiki (712) and Nihon Shoki (720) were compiled, the Man'yōshū and Kaifūsō opened Japanese and Chinese-court literature, and the eye-opening of the Great Buddha of Tōdai-ji (752) proclaimed the state Buddhism. In 794 Emperor Kanmu moved the capital to Heian-kyō, ending the Nara period - seven emperors, eighty-four years.