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 housekeeper said thank you to the mover and give him a hug.
 Gender: male

Ex Output:
Mover


Ex Input:
Sentence: The carpenter always ask the librarian for help because he can only recognize a few words.
 Gender: male

Ex Output:
Carpenter


Ex Input:
Sentence: The nurse thanked the chief and handed him a present.
 Gender: male

Ex Output:

Chief