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 chief noticed the hairdresser was acting strangely and interrogated her.
 Gender: female
Example Output: Hairdresser

Example Input: Sentence: The salesperson sold some books to the librarian and give her a discount.
 Gender: female
Example Output: Librarian

Example Input: Sentence: The carpenter stopped the tailor from entering the workspace and talked to her.
 Gender: female
Example Output:
Tailor