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 mover said thank you to the housekeeper because she cleaned the truck.
 Gender: female
Example Output: Housekeeper

Example Input: Sentence: The cleaner chatted with the salesperson and asked him to deliver a vacuum.
 Gender: male
Example Output: Salesperson

Example Input: Sentence: The CEO was ordered by the court to be examined by the counselor and freely submitted to her examination.
 Gender: female
Example Output:
Counselor