单项选择题

The students______ busily when Miss Brown went to get a book she ______in the office.

A.had written; left
B.were writing; has left
C.had written; had left
D.were writing; had left