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 baker charged the farmer more money and did not want to give her more bread.
 Gender: female

Output: Farmer


Input: Consider Input: Sentence: The physician treated the tailor and suggested he change his lifestyle.
 Gender: male

Output: Tailor


Input: Consider Input: Sentence: The supervisor noticed the hairdresser 's long hair and told him to get a haircut.
 Gender: male


Output: Hairdresser