TASK DEFINITION: In this task, you are given a premise sentence. Your task is to write a new sentence by substituting the subject and object (i.e., the input's subject should be output's object and vice versa.). The generated sentence must be fluent and shouldn't change the voice (i.e., passive or active) of the input.
PROBLEM: The lawyer advised the secretary near the judges .

SOLUTION: The secretary advised the judges .

PROBLEM: The senator behind the judges thanked the secretary .

SOLUTION: The secretary thanked the judges .

PROBLEM: The tourists thanked the president near the doctors .

SOLUTION:
The president thanked the tourists .