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 janitor stopped the editor and showed her how to clean the floor.
 Gender: female
Example Output: Editor

Example Input: Sentence: The lawyer offered a free legal advice to the attendant, which she was in dire need of.
 Gender: female
Example Output: Attendant

Example Input: Sentence: The sheriff told the counselor that she was under investigation.
 Gender: female
Example Output:
Counselor