Water
"Whoever takes a bunch of tickets, will get a water tower!"
from the movie "The Diamond Arm"
Vitaliy is the director of a small water supply company, working at a water tower. This tower is a cylindrical structure with a height of H meters and is initially filled to the brim with water.
Due to its age, the water tower frequently develops leaks, which Vitaliy occasionally repairs. As a director, he is keen to monitor the water level in the tower but prefers not to climb up every time to check.
Your task is to write a program that processes the following types of requests:
At time t, a leak appears at a height h with a water outflow rate of v.
At time t, Vitaliy repairs all leaks at height h.
At time t, Vitaliy wants to know the current water level.
Water will only flow out of a hole if the water level is above the hole's height. Initially, the tower is full. The outflow rate v indicates that in one unit of time, a volume of water equivalent to v meters of water in the tower is lost through the hole.
Input
The first line contains two integers n and H (1 ≤ n ≤ 10^5; 1 ≤ H ≤ 10^9) — the number of requests and the height of the water tower. The following n lines describe the requests. Each line starts with an integer k (1 ≤ k ≤ 3) indicating the type of request. Depending on the request type, the line may include one to three integers from t, h, and v (0 ≤ t ≤ 10^9; 0 ≤ h ≤ H; 1 ≤ v ≤ 10^9). Requests are given in chronological order, with no two requests occurring at the same time.
Output
For each request of the third type, output a single number representing the water level in the tower at that specific time.
The output must have a relative or absolute accuracy of 10^{-9}. This means if the correct answer is a, and your output is p, it will be considered correct if |a - p|/ max(a, 1) ≤ 10^{-9}.