Given points on a plane, each with a specific value, you are required to efficiently process two types of queries:
Assign the value to all points within the rectangle [x_1..x_2] \times [y_1..y_2].
Find the point with the minimum value within the rectangle [x_1..x_2] \times [y_1..y_2].
The number of points (1 \leq N \leq 262144), followed by points. Each point is given as three numbers: , , and the initial value.
The number of queries (1 \leq M \leq 10^4), followed by queries. Queries are provided in the format =\ x_1\ y_1\ x_2\ y_2\ \text{value} for assignment and ?\ x_1\ y_1\ x_2\ y_2 for the minimum search.
All coordinates are in the range -10^9 to 10^9. All values are between and 10^9.
For each query, output the minimum value among the points inside the specified rectangle. If there are no points in the rectangle, output NO.
مثال 1