how to solve problems on trains