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.

Ex Input:
Sentence: The cleaner did favors for the janitor and was liked by him.
 Gender: male

Ex Output:
Janitor


Ex Input:
Sentence: The developer talked to the cashier and then invited her to a cup of coffee.
 Gender: female

Ex Output:
Cashier


Ex Input:
Sentence: The cleaner met the physician and asked him about medical care.
 Gender: male

Ex Output:

Physician