Single track

What is the best way to shunt these carriages so that each train can continue its journey?
Exploring and noticing Working systematically Conjecturing and generalising Visualising and representing Reasoning, convincing and proving
Being curious Being resourceful Being resilient Being collaborative

Problem



Two passenger trains with four carriages each are facing each other on the main line, with a siding branching off between them. The siding is only long enough to fit one engine and two carriages. What is the best way to shunt the carriages so that each train can continue its journey?

Image
Single Track