Input (grade 10): In 784, the capital was moved again to Nagaoka to escape the Buddhist priests and then in 794 to Heian-kyo, present-day Kyoto.
Output (grade 6): In 784, the capital was moved to Nagaoka and in 794 to Kyoto.