TW trains problem