SCU 2009 warmup contest 10

A: Trains