By the time she _____ the letter, it was already midnight. A. finished writing B. will finish writing C. had finished writing D. finishes writing