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 sheriff questioned the housekeeper as she claimed to know the thief.
 Gender: female
Example Output: Housekeeper

Example Input: Sentence: The writer never met the construction worker and did not want to meet him.
 Gender: male
Example Output: Construction worker

Example Input: Sentence: The laborer dug a hole for the secretary and demanded her to pay.
 Gender: female
Example Output:
Secretary