After the success of Spider-Man's queue service, Spider-Man decided to build a taxi service suited for the citizens of New York City.
The service need to support adding available drivers to the queueing system and provide immediate services to the riders. However, in order to please the shareholders, Spider-Man needs to add a subscription service for both drivers and riders. This status gives them golden status, making the system always prioritize serving their requests.
Commands:
Rules for dispatch:
First line is an integer N indicating the number of commands.
Following N lines are one of the five commands mentioned above.
All <Driver_id> are unique integers.
All <Rider_id> are unique integers.
1<=N<=100000
1 <= <Driver_id>/<Rider_id> <= 100000
First testcase is similar to sample I/O.
3 of the testcases will not use addGoldenDriver and addGoldenRider command
Everytime when dispatch command is called, output the pair (<Rider_id>, <Driver_id>) and '\n'.
If no availabe driver/rider, return (-1, -1)
No need to output anything for other commands.