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.

Ex Input:
Sentence: The laborer owed the tailor because she offered to make a free suit.
Gender: female

Ex Output:
Tailor

Ex Input:
Sentence: The sheriff protected the writer because she is under attack.
Gender: female

Ex Output:
Writer

Ex Input:
Sentence: The librarian hid the book from the supervisor and told him to look somewhere else.
Gender: male

Ex Output:
Supervisor