Trial and error on the front side. Would have been better if there was some structural or visual clue indicating the safe route. Spoiler You can use the slider and door on the back side trap structure to nudge B to the ground so he can walk to the win.