Input (grade 8): The River flows through Seoul and then merges with the Imjin River shortly before it flows into the Yellow Sea.
Output (grade 8): The river flows through Seoul then shortly merges with the Imjin River shortly before it flows in to the Yellow sea.