Replace "robot" with "train" and repeat the logic.