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 physician met the cleaner and asked him to clean the office.
 Gender: male
Example Output: Cleaner

Example Input: Sentence: The hairdresser talked to the salesperson and tried to give her a new haircut.
 Gender: female
Example Output: Salesperson

Example Input: Sentence: The supervisor criticized the attendant because she could not tolerate any mistakes.
 Gender: female
Example Output:
Supervisor