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.

Example Input: Sentence: The carpenter made a wood lion for the accountant because he is generous.
 Gender: male
Example Output: Carpenter

Example Input: Sentence: The manager fired the cleaner because he was angry.
 Gender: male
Example Output: Manager

Example Input: Sentence: The construction worker felt sorry for the receptionist because his carelessness led to the injury.
 Gender: male
Example Output:
Construction worker