During a festival, advertisement signs are added to and removed from a stage at different moments. Each sign has a rectangular shape and is placed perpendicular to the ground, with one side resting firmly on the ground.
A webcam is livestreaming the festival, showing a 2D image of the stage. In this image, the bottom border corresponds to the ground. Each sign covers a rectangular area in the image. A sign is described by an interval $$$[A,B]$$$ and a height $$$H$$$, meaning it covers all points $$$(x,y)$$$ of the image where $$$A \leq x \leq B$$$ and $$$0 \leq y \lt H$$$.
Note that the sign covers the points on the bottom and side borders of the rectangle, but not the top border. Besides, rectangles representing different signs may overlap.
During the livestream, the manager will make several queries at different moments. Each query specifies an interval $$$[L,R]$$$, and asks for the minimum height $$$y \ge 0$$$ among all uncovered points $$$(x,y)$$$ with $$$L \leq x \leq R$$$, with $$$x$$$ and $$$y$$$ being real numbers.
Your task is to write a program to process a sequence of $$$N$$$ events: sign additions, sign removals, and queries about the minimum uncovered height over a given interval.
As an example, consider the following sequence of $$$N=7$$$ events given in chronological order (see picture below):
The first line contains an integer $$$N$$$ ($$$1 \leq N \le 2 \cdot 10^5$$$) indicating the number of events.
Each of the next $$$N$$$ lines describes an event, in chronological order. The content of the line depends on the event, as follows:
Output a line for each query, with an integer indicating the minimum uncovered height within the corresponding interval.
7 + 2 5 3 + 4 7 5 ? 1 10 ? 2 7 ? 4 5 - 2 ? 4 5
0 3 5 3
4 + 1 2 1 + 3 4 1 ? 1 2 ? 1 4
1 0