Which is the direct object of the sentence?

Jamie wrote a long letter to the editor of the magazine.

1.magazine
2.editor
3.letter
4.Jamie