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 construction worker knew the nurse was the best and asked her for an examination.
 Gender: female
Example Output: Nurse

Example Input: Sentence: The supervisor gave the housekeeper a ride because she lives far away.
 Gender: female
Example Output: Housekeeper

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