Chinese: 他回来的时候，我刚好写完了信。
English: I had just written the letter when he came back.