In this problem, your task is to maintain a multiset $$$T$$$ whose elements are pairs $$$(v_i,w_i)$$$. Initially, $$$T$$$ is empty. You are required to perform $$$n$$$ operations, each of which is one of the following three types:
There is only one test case in each test.
The test case starts with a line containing a single integer $$$n$$$ ($$$1 \leq n \leq 200\,000$$$), denoting the number of operations.
Each of the next $$$n$$$ lines describes an operation in the formats described in the statement above.
For each query, print a single line containing a single integer, denoting the value of $$$w$$$ that you find, or "-1" if there is no finding.
6+ 4 5+ 3 4? 2? 3- 3 4? 4
4 5 -1
| Name |
|---|


