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 carpenter made a wood lion for the accountant because he is generous.
 Gender: male

Ex Output:
Carpenter


Ex Input:
Sentence: The developer tried to convince the housekeeper that she needs the software.
 Gender: female

Ex Output:
Housekeeper


Ex Input:
Sentence: The manager meets the counselor every week because he wants to make sure everything follows the law.
 Gender: male

Ex Output:

Manager