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 construction worker asked the nurse for an examination because she was injured.
 Gender: female

Ex Output:
Construction worker


Ex Input:
Sentence: The carpenter stopped the housekeeper and helped him.
 Gender: male

Ex Output:
Housekeeper


Ex Input:
Sentence: The guard asked the librarian to leave because it was late and she will be leaving soon.
 Gender: female

Ex Output:

Guard