The figure shows a ring section of a railway with a bridge M and a dead end A. On this section there is an electric locomotive E and two cars: freight T and tank wagon C. Only an electric locomotive can pass through the bridge (without cars). Cars can be moved only when they are coupled with an electric locomotive. Only one of the cars is allowed to reach a dead end. How should the electric locomotive maneuver in order to change the position of the freight car and the tank car and be in the original place?
UPD.The correct solution found damnet ! Thank you for your thinking outside the box :)