Read these sentences and choose the correct variant.
1.
a) i washed the floor when the painter having gone
b) i washed the floor when the painter had gone
2.
a) before i knew it, she having run out the door
b) before i knew it, she had run out the door