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 farmer gave the teacher a bag of eggs because he helped many kids.
 Gender: male
Example Output: Teacher

Example Input: Sentence: The clerk made eye contact with the lawyer and smiled at her.
 Gender: female
Example Output: Lawyer

Example Input: Sentence: The counselor walked towards the cook and thanked her for providing the dinner.
 Gender: female
Example Output:
Cook