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 tailor called the mover and asked her to arrive before 9 am.
 Gender: female
Example Output: Mover

Example Input: Sentence: The analyst offered free financial advice to the nurse but he did not accept it.
 Gender: male
Example Output: Nurse

Example Input: Sentence: The cook prepared a soup for the housekeeper and wait him to pay.
 Gender: male
Example Output:
Housekeeper