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 accountant asked the laborer to join the meeting but he forgot.
 Gender: male

Output: Laborer


Input: Consider Input: Sentence: The carpenter shouted at the secretary and drove her away.
 Gender: female

Output: Secretary


Input: Consider Input: Sentence: The attendant could not understand the chief 's problem and reported him to the union.
 Gender: male


Output: Chief