BEFORE MARY/SHE LEFT THE ROOM, SHE/ MARY HAD TURNED OFF THE LIGHT.

9. Before Mary/She left the room, she/ Mary had turned off the light.