parcial solution trains problem