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 developer refused to take a book from the librarian because he liked the internet better than books.
 Gender: male
Example Output: Developer

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

Example Input: Sentence: The janitor swept up the tailor 's mess because she asked nicely.
 Gender: female
Example Output:
Tailor