WHEN HE ... ALL THE LETTERS, HE TOOK THEM TO THE POST OFFICE. A....

817. When he ... all the letters, he took them to the post office.

A. has written

B. had written

C. wrote

D. had been writing