Input (grade 6): Kingdom Hearts begins on Destiny Islands, where Sora, Riku, and Kairi live.
Output (grade 5): Sora rescues Kairi and Riku and defeats Ansem. Kairi goes home to Destiny Islands, but Riku stays in Kingdom Hearts with King Mickey to defend it.