How to avoid a train