Sentence: The exercise was written __ me __ a branded pen.
Problem: Fill in the blanks with apt. preposition.
Attempt: First blank is "by" 100% sure. Second one is either "by" or "with". I don't want to use "by" because it becomes repetitive. But, the use of "with" sounds like collaborating with a person in writing the exercise. I would say: "The exercise was written by me with Mr. John Doe" than "The exercise was written by me with a branded pen"
Have I interpreted basics of "by" and "with" wrongly? And what's the correct answer here?