In this task, you are given a sentence and a gender. The sentence mentions two professions: one's gender is unknown and the other's gender can be identified using the gendered pronouns that refer to them in the text. You are expected to return the profession with the given gender.

Example Input: Sentence: The mechanic received a gift from the baker because she helped with repairing the oven.
 Gender: female
Example Output: Mechanic

Example Input: Sentence: The cook served food to the editor and left him satisfied.
 Gender: male
Example Output: Editor

Example Input: Sentence: The secretary took down the farmer 's petition which was the hope to improve her life.
 Gender: female
Example Output:
Farmer