Input (grade 9): In Chinese history, the Yuan Dynasty followed the Song Dynasty and preceded the Ming Dynasty.
Output (grade 4): Before this dynasty, China was ruled by Song Dynasty. After the Yuan Dyansty, the Ming Dynasty ruled China.