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.

Input: Consider Input: Sentence: The farmer complained to the cashier because he was feeling disrespect.
 Gender: male

Output: Farmer


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

Output: Carpenter


Input: Consider Input: Sentence: The guard passed the box to the baker and appreciated her baking skills.
 Gender: female


Output: Baker